Windows Phone Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...




Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Developer

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 08-05-2003, 08:06 PM
Pupil
Join Date: Apr 2003
Posts: 10
Default ASP.NET

The ASP.NET version (C#) is this:

if( Request.Browser("IsMobileDevice") == true )
{
Response.Redirect( "MobilePage.aspx");
}

Although I've read something somewhere that this messes up search engine crawlers.

-Mark Schmidt
 
Reply With Quote
  #22 (permalink)  
Old 10-28-2003, 02:19 AM
Thinker
Join Date: Dec 2005
Posts: 449

Does that first piece of code detect Palm OS, Linux, and Symbian browsers? Thanks
 
Reply With Quote
  #23 (permalink)  
Old 01-29-2004, 05:28 PM
Ponderer
Join Date: Jul 2003
Posts: 103
Send a message via AIM to cklaszlo

Steven, our Project Manager, noticed that the original auto detect code was missing some info.

Here is our fix and seams to work:


Code:
$ua = $HTTP_USER_AGENT;
if (stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or stristr($ua,
"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68") or stristr($ua,
"Syncalot") or stristr($ua, "Blazer") or stristr($ua, "NetFront"))
{
$DEVICE_TYPE="MOBILE";
}

if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE")
{
$location='http://pda.thrillnetwork.net/';
header ('Location: '.$location);
exit;
}
We have this running on our beta test site. We will be releasing the live site in the next few days. If you want to see the code working send me a PM and we can talk. Thanks.
 
Reply With Quote
  #24 (permalink)  
Old 03-10-2005, 10:38 PM
Ponderer
Join Date: Jul 2003
Posts: 67
Default I've been playing with your script...

...for my site, and you need to define what $ua is before you can use it:

$ua = @find_environmental("HTTP_USER_AGENT");

Then you can do a string compare on the value of $ua to determine if someone is surfing from a mobile browser...
 
Reply With Quote
  #25 (permalink)  
Old 03-11-2005, 08:24 PM
Ponderer
Join Date: Jul 2003
Posts: 103
Send a message via AIM to cklaszlo

We have it running on our site now for the last year.

www.thrillnetwork.com

browse from a PDA links to:

mobile.thrillnetwork.com

We just added our complete Database of Rides and Parks

This works for Blackberry, PPC, Plam OS. Very cool.
 
Reply With Quote
  #26 (permalink)  
Old 01-30-2008, 05:32 AM
Neophyte
Join Date: Jan 2008
Posts: 1
Default Does the code not work with Apache 2.0?

Hi,

I used Medic119's code and it worked great for several weeks, but then it stopped working (website behaved as the directives were not there-- did not redirect to the mobile folder). Could this have anything to do with the fact that my host upgraded to Apache 2.0?

Any insight would be appreciated.

Thanks.
 
Reply With Quote
  #27 (permalink)  
Old 10-10-2008, 05:17 PM
Neophyte
Join Date: Oct 2008
Posts: 2

Here are a few methods how to detect a mobile device: http://beradrian.wordpress.com/2008/...e-recognition/
 
Reply With Quote
  #28 (permalink)  
Old 10-11-2008, 12:23 AM
Neophyte
Join Date: Oct 2008
Posts: 2

I described in here a few methods for detecting a mobile device: http://beradrian.wordpress.com/2008/...e-recognition/
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://forums.thoughtsmedia.com/f415/mobile-device-re-direct-code-47184.html
Posted By For Type Date
6 Ways to create a mobile version of your site - 10,000 Words This thread Refback 12-28-2010 06:44 PM
shingr's mobile Bookmarks on Delicious This thread Refback 12-23-2010 02:56 PM
Windows Phone Thoughts: Mobile Device Re-Direct Code This thread Refback 06-09-2010 10:18 PM
daveknapik's css and mobile Bookmarks on Delicious This thread Refback 06-02-2010 08:33 PM
6 Ways to create a mobile version of your site :: 10,000 Words This thread Refback 04-19-2010 11:02 PM
10,000 Words :: where journalism and technology meet This thread Refback 01-21-2010 04:55 PM
6 ways to create a mobile version of your site Your TwiTwi This thread Refback 08-04-2009 06:25 PM
Mobiel device automatisch doorlaten sturen - SiteDeals This thread Refback 04-18-2009 04:45 PM
Eksperten | Programmering :: Script :: JavaScript :: Tjekke om bruger er på mobiltelefon This thread Refback 12-06-2008 07:07 AM
Mobile versions of websites This thread Refback 12-01-2008 04:34 AM
6 Ways to create a mobile version of your site :: 10,000 Words :: multimedia, online journalism news and reviews This thread Refback 10-08-2008 12:09 PM
10,000 Words :: where journalism and technology meet :: multimedia, online journalism news and reviews This thread Refback 10-07-2008 09:10 PM
Forum fotografia : photo4u.it :: Fotografia digitale e analogica :: aiuto web This thread Refback 08-08-2008 10:21 PM
Forum fotografia : photo4u.it :: Fotografia digitale e analogica :: aiuto web This thread Refback 08-08-2008 03:18 PM


All times are GMT +1. The time now is 02:45 PM.



Search Engine Friendly URLs by vBSEO 3.6.0