Log in

View Full Version : Auto Detect Browser


cklaszlo
01-13-2004, 06:06 PM
Hi. We are building out the PDa version of our site now and I was wondering if there was any code to auto detect a browser (PPC and Palm) so we can automatically redirect users to the right page for the PDA version of the site.

Thanks

Jason Dunn
01-13-2004, 06:33 PM
http://www.pocketpcthoughts.com/articles.php?action=expand,15385

:D

cklaszlo
01-13-2004, 06:39 PM
Thanks!!! I did a search but must have missed it. I knew it had to be here some where.

cklaszlo
01-15-2004, 06:22 PM
We are close to launching the News section of the PDA site. :)

cklaszlo
01-29-2004, 05:10 PM
Is there a way to Auto Detect Palm Devices too? Most seam to use: netfront/3.0 ?

Thanks

Alex

cklaszlo
02-03-2004, 03:27 PM
Issue:

If we link at the bottom of our mobile page to "Desktop Site" that link to www.thrillnetwork.com but because of the auto detect script it links right back to the PDA site. Anyway to bypass this?

PS: I feel like I'm alone here. :)

Wiggster
02-03-2004, 04:31 PM
It's just a simple something you have to add to the end of the query string to over-ride it.

Example using the code provided:


<?

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") )
{
$DEVICE_TYPE="MOBILE";
}

if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE" and $desktop != "true")
{
$location='mobile/index.php';
header ('Location: '.$location);
exit;
}

?>


That's just a quick example, but you could have a link at the bottom of the page for index.php?desktop=true, and it won't use the mobile version.

cklaszlo
02-04-2004, 04:48 PM
Thanks. Works like a charm!