View Full Version : How to determine if a visitor is using a phone or computer

07-25-2008, 06:14 PM
Hi everyone,

Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site?

I would like to make the intro process much better than a simple "click here for HTML version or click here for Flash version". I would like for it to simply redirect to the page I set it to go to depending on whether or not they're using a regular browser or a mobile browser.

How would I go about this?

Thank you all very much in advance.

Philip M
07-25-2008, 07:17 PM
Hi everyone,

Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site?

No, not possible.

07-25-2008, 07:44 PM
You could make a stylesheet for 'handheld' or for 'screen' but that would probably not work for sites made totally in flash. they aren't a good idea anyway so, this may be a solution for you.


07-25-2008, 08:22 PM
well i would think that you'd be able to tell what browser they're using... and since phones use different browsers.......

rnd me
07-26-2008, 02:39 AM
i think a better way would be to determine flash capability, and show the flash if it supports it, or the html if it don't.

also, i would think then a screen.width < 700 would be highly indicative of a mobile device: fewer than 1&#37; of real browsers use 640X480 (http://www.w3schools.com/browsers/browsers_display.asp). iphone is certainly lower (http://www.everythingicafe.com/iphone-faq/what-is-the-resolution-of-the-iphone-screen/)

also, you could simply eliminate possibilies and assume a phone at the end.

assume the answer is no to all of these:
are you IE ? are you FireFox? are you Opera? are you Safari? (if yes, is your screen.width > 700)? you must be a phone!

07-28-2008, 11:27 PM
Thanks rnd me,

The screen width trick could work beautifully.

I will try to put that into shape.

I'll try a simple if...then procedure with that and see how it works.

Thanks again.

10-11-2010, 01:38 AM

I have noticed a few Web sites where they make the href="tel:" tag work for mobile users, but it is not available via the computer.

So, how would I go about implementing something like this?

Please bear in mind that my javascript skills = noobish.

Many thanks! http://reaganator.com/comments/super.gif

10-11-2010, 05:05 AM
you could use navigator.platform this would require you to manual list the id of all the major browsers or phones

06-15-2011, 01:35 PM
:confused:Hi there,

Am I going mad here? I use

Dim BCaps As HttpBrowserCapabilities
Session("Width") = BCaps.ScreenPixelsWidth

On IE9 this gives me 640

If this is less that 700 as is suggested above then everything will be as for mobiles.

I also have issues with Safari as it doesn't work on my ASP.NET VB Menus.

What a nightmare!

Any help gratefully received.


06-15-2011, 03:23 PM
The thread is old and obsolete. It is possible, with a high precision (not absolute, but high) to detect smartphones: