PHP and PDAs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

PHP and PDAs

Post by Jr »

Ok, I'm not sure how to do this (that's why I'm posting obviously) but I was just wondering if PHP has a function that checks for a PDA connecting to a page instead of a PC or just how I would do that. I have a lot of JavaScript on one of my sites and it doesn't work on my PDA so I want to make a "PDA spacific" site that just loads when a PDA connects to my site. If someone could post up and let me know how I could do this I would greatly appriciate it as always.

Thanks,
Jr-
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Just check $_SERVER['USER_AGENT'].

It's not perfect and can be spoofed but it should help with pretty much all standard PDA setups.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

get_browser() and/or the associated data file could be of help here.
Post Reply