views:

89

answers:

4

Is there a way to get the type of mobile Phone when a phone connects to a mobi site using PHP?

A: 

I think your only way is to parse the user agent HTTP header. You'll get that information in the global variable $_SERVER['HTTP_USER_AGENT']. See http://php.about.com/od/learnphp/p/http%5Fuser%5Fagent.htm

rossoft
+1  A: 

You can read the user agent with PHP, and this might give you a clue.

http://detectmobilebrowsers.mobi/ <- Free function to read read the user agent with PHP.

Björn
+1  A: 

Look at wurfl. It can match all 28000something different user-agent headers to a specific mobile phone and give you it's attributes (sreenwidht/screenheight/canplayvideo/etc)

Toad
A: 

There is a working draft from de W3C called Device Description Repository Simple API. There is a DDR Service, a reference implementation that can work with WURFL, DeviceAtlas, and UAProf under the hood.

Guido