Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    85
    Thanks
    25
    Thanked 0 Times in 0 Posts

    How to determine if a visitor is using a phone or computer

    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.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,015
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by cmxsevenfoldxmc View Post
    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.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #4
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    well i would think that you'd be able to tell what browser they're using... and since phones use different browsers.......

  • #5
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,346
    Thanks
    11
    Thanked 589 Times in 570 Posts
    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. iphone is certainly lower

    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!
    Last edited by rnd me; 07-26-2008 at 01:46 AM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • Users who have thanked rnd me for this post:

    cmxsevenfoldxmc (07-28-2008)

  • #6
    New Coder
    Join Date
    Jan 2008
    Posts
    85
    Thanks
    25
    Thanked 0 Times in 0 Posts
    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.

  • #7
    New Coder
    Join Date
    Oct 2010
    Location
    Like me, on a tiny speck of dust floating in the Virgo Cluster.
    Posts
    29
    Thanks
    1
    Thanked 1 Time in 1 Post

    Question href="tel" for mobile users only

    Hello!

    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!

  • #8
    Regular Coder
    Join Date
    Apr 2010
    Posts
    163
    Thanks
    3
    Thanked 25 Times in 25 Posts
    you could use navigator.platform this would require you to manual list the id of all the major browsers or phones

  • #9
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Cheers

  • #10
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    The thread is old and obsolete. It is possible, with a high precision (not absolute, but high) to detect smartphones:

    http://www.hand-interactive.com/reso...javascript.htm
    http://www.hand-interactive.com/reso...mobile-php.htm
    http://www.hand-interactive.com/reso...obile-java.htm
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •