www.webdeveloper.com
Results 1 to 2 of 2

Thread: How do I Detect for Mobile Browser

  1. #1
    Join Date
    Mar 2010
    Location
    Canada
    Posts
    79

    How do I Detect for Mobile Browser

    I downloaded the source code on how to detect mobile browser for detectmobilebrowser.com but they do not have any documentation and code is very cryptic.
    I just want it to do this.
    If it is a mobile browser then take the user to this site: http://fmdentalcentre.com/mobile
    I tried modifying the source code but it does not work.

    Code:
    <?php
    $useragent=$_SERVER['HTTP_USER_AGENT'];
    if(preg_match('/(android|bb\d+|meego) 
    ...some code...
    header('Location: http://www.fmdentalcentre.com/mobile');
    ?>

  2. #2
    Join Date
    Aug 2010
    Posts
    5
    What framework/environment are you using, many times your framework has a built-in method in doing this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles