views:

63

answers:

5

how can i detect if someone visits my website using safari or iexplorer via their mobiles? i think the answer may be using the USER_AGENT variable, but i'm not really sure, so if you have a better idea or already a code running it would be just great to share :)

+1  A: 

http://detectmobilebrowsers.mobi/

great source

Grumpy
cool, thanks man!
leanyo martinet
+3  A: 

Look at this:

http://detectmobilebrowser.com/

PHP script:

http://detectmobilebrowser.com/download/php

NAVEED
just perfect! :)
leanyo martinet
A: 

Have you looked into the browscap extension?

I use it with great success for detecting iPhone / other mobiles.

http://browsers.garykeith.com/downloads.asp

The downside is that you need to manually update it from time to time (every couple of months or so)

or phpbrowscap if you dont have access to install extensions:

http://code.google.com/p/phpbrowscap/

Stann0rz
+2  A: 

I can see that there two parts to this question

  1. What fields do we use to detect the device type

    • User Agent Header
    • UAProf
  2. How do we use these fields to find out the device type and the device characteristics.

For this you should have a device database that stores a mapping between the above mentioned fields and the corresponding device characteristics and also have an efficient algorithm to query this database.

Following could be your solutions.

  • build in house database and data access library ( cons re-inventing the wheel, problems with updating the database as and when new device come to the market, which
    practically is everyday )

    • WURFL ( pros contains both database and access library, open source, free, used to be the defacto standard till a few years ago and is very mature, cons is not always upto date)

    • Device Atlas from .Mobi ( pros uptodate, has efficient data access library, provides a wide range of device characterestics, IMHO best option | cons paid )

    BTW, Which language are you using to build you website ?

Arup Chowdhary
@arup thanks for your answer man, as the question said i am using PHP and @naveed showed me a script that worked right away
leanyo martinet
+1  A: 

btw - If you are using PHP for development, check out this link - Device detection using Device Atlas and PHP

Arup Chowdhary