Page 1 of 1

Is the PC or SmartPhone accessing my site ?

Posted: Wed Sep 07, 2005 12:40 pm
by anjanesh
Say I have a site called mysite.com and mysite.com/mobile containing PHP scripts that'll generate the WML pages for mobile devices using WAP.
If someone goes to mysite.com on his mobile device, he'll automatically be redirected to mysite.com/mobile.

How can I detect if the browser is a mobile or PC browser ?

Thanks

Posted: Wed Sep 07, 2005 12:43 pm
by feyd
I'd hazard to guess by the simplicity of the mobile's request headers.. particularlly the user-agent string it probably a good indication. :)

Posted: Wed Sep 07, 2005 12:49 pm
by Weirdan
as well as Accept header