Forum Moderators: coopster

Message Too Old, No Replies

Detecting if there is a mobile phone

in php

         

adni18

2:16 am on Oct 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey. Is there a way (maybe a variable) to detect whether the user is using a mobile phone with internet to view your website? Thanks.

elgumbo

9:29 am on Oct 4, 2005 (gmt 0)

10+ Year Member



I'm not sure if there are standard browsers that are specific to mobiles but you could use

echo $_SERVER['HTTP_USER_AGENT'];

to display the browser info to see if what you get.

dragonthoughts

10:12 am on Oct 4, 2005 (gmt 0)

10+ Year Member



For what it's worth, The signature for accessing my site with a Nokia6230 mobile phone is:

Nokia6230/2.0 (05.35) Profile/MIDP-2.0 Configuration/CLDC-1.1

I suggest you set up a page consisting of

<?php phpinfo();?>

Then access it from your own mobile phone and see what appears in the various values, and work from there.