cloudy cloudy

Author Topic: Cell phone redirect script  (Read 2956 times)

0 Members and 1 Guest are viewing this topic.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Cell phone redirect script
« on: April 23, 2011, 01:51:47 AM »
I've seen it somewhere, but cant find it. Im looking for a script that would redirect a cell phone to my cell page, rather than to my main page. Thanks
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline drobbins

  • Posts: 1,694
  • Kentucky, USA
    • Cave Country Weather
Re: Cell phone redirect script
« Reply #1 on: April 23, 2011, 02:03:54 AM »
I don't think it had it's own thread but was in the WDL for iphone thread. Here is the link:
http://detectmobilebrowsers.mobi/

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #2 on: April 23, 2011, 02:10:25 AM »
Thanks for the link. I got the code here..

Code: [Select]

once('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'http://www.snoqualmieweather.com/iphone.php',false);


Do you know where I'd place it for it to work?
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline drobbins

  • Posts: 1,694
  • Kentucky, USA
    • Cave Country Weather
Re: Cell phone redirect script
« Reply #3 on: April 23, 2011, 02:13:51 AM »
It is placed on the index page:
Code: [Select]
require_once("Settings.php");
require_once("common.php");
require_once('mobile_device_detect.php');
mobile_device_detect('http://www.cavecountryweather.com/smartphone/',false,'http://www.cavecountryweather.com/smartphone/','http://www.cavecountryweather.com/cell.php','http://www.cavecountryweather.com/cell.php','http://www.cavecountryweather.com/cell.php','http://www.cavecountryweather.com/cell.php',false,false);;
« Last Edit: April 23, 2011, 02:15:54 AM by drobbins »

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #4 on: April 23, 2011, 02:23:02 AM »
I just tried placing it where you have it, and it kills my page.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #5 on: April 23, 2011, 02:24:58 AM »
This is what i tried...


Code: [Select]

require_once("Settings.php");
require_once("common.php");
once('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'http://www.snoqualmieweather.com/iphone.php',false);

"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline mfd38

  • Posts: 1,179
  • Massachusetts
    • Medfield, MA Weather
Re: Cell phone redirect script
« Reply #6 on: April 23, 2011, 02:38:03 AM »
This is what i tried...


Code: [Select]

require_once("Settings.php");
require_once("common.php");
once('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'http://www.snoqualmieweather.com/iphone.php',false);


Hi Mark, Looking at drobbins' code it looks like you're missing the word 'require' for the require_once('mobile_device_detect.php'); maybe that is causing the problem.
« Last Edit: April 23, 2011, 02:41:46 AM by mfd38 »

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #7 on: April 23, 2011, 02:44:02 AM »
I was missing the mobile_device_detect.php file

The redirect works on my Android phone now, hopefully it works for every other phone.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 26,170
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • https://www.realweatherstation.com
Re: Cell phone redirect script
« Reply #8 on: April 23, 2011, 02:53:32 AM »
Why not include it in some common (header?) file so that it will redirect from any page. Then it would help if someone followed a link to a page other than the index.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #9 on: April 23, 2011, 02:57:03 AM »
hmmmmm   :-k not a bad idea... I'll try messing with that.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,900
  • North Bend, WA
    • North Bend Weather
Re: Cell phone redirect script
« Reply #10 on: April 23, 2011, 03:01:46 AM »
I get an error on my phone when i put it in the header
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

Offline drobbins

  • Posts: 1,694
  • Kentucky, USA
    • Cave Country Weather
Re: Cell phone redirect script
« Reply #11 on: April 23, 2011, 05:07:35 AM »
Sorry to abandon you - got side tracked. I checked it out on my HTC Tilt and I see that you got it working.  :thumbleft:

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Posts: 5,934
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Cell phone redirect script
« Reply #12 on: April 23, 2011, 05:43:34 AM »
Redirection sounds cool, but I am not sure this is such a great idea.  I frequently view the full sized version of the website with my Droid on purpose, because the mobile version lacks the full sites info as most mobile sites are just a sub-set of the full sites available info.

By forcing the user to the mobile version, they would get trapped into not being able to access the full site if they want to.  The mobile browser my Droid has is quite capable of viewing many full sites, not necessarily as easy (need to zoom in etc), but still able to view it.  Even Flash and JavaScripted parts.

Instead, I would use the detection to provide a link that stands out that informs the user of the mobile sites availability and an easy way to get to it.

Its kind of the same thing you can do to notify a user that they have JavaScript turned off.  They can use the site, but at least they know why some parts of it might not be working properly.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline drobbins

  • Posts: 1,694
  • Kentucky, USA
    • Cave Country Weather
Re: Cell phone redirect script
« Reply #13 on: April 23, 2011, 12:37:54 PM »
I did have one ipad user that emailed complaining about the redirect, so the ipad was taken off the redirect list. I still like the redirect because I found that many people have troubles when they are instructed to add a "forward slash smartphone" after cavecountryweather.com. The "forward slash" gets them. :wink:  As for those who might want access to the full content sometimes, there is a link on the bottom of the cell pages that goes to index2.php which is exactly the same as the index.php except it does not have the redirect script.

 Looking at the page loads, a few people do use the cell page regularly. Rarely is the smartphone page viewed - like only 5 times that I can remember.

Offline up10ad

  • Posts: 98
  • Pardon my driving, I'm reloading.
  • Delta, CO USA
    • Delta, CO Weather
Re: Cell phone redirect script
« Reply #14 on: April 23, 2011, 01:16:47 PM »
Here is how I handle mobile devices.  http://www.weather-watch.com/smf/index.php/topic,40827.msg369855.html#msg369855

I think it's important to let the visitor dtermine ultimately if he wants the mobile or full pages.  The link above sets a cookie and allows visitors to switch; the cookie keeps the redirection from happening any more for that session.  
« Last Edit: April 23, 2011, 01:22:19 PM by up10ad »
Rick
Have you joined USAWeatherFinder.com yet?


 

cumulus