Results 1 to 4 of 4

Thread: Browser user agent

  1. #1

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Browser user agent

    hi, i am redesigning my website and i have a php redirection page. i have made myself a script that checks what browser it is and redirects to the right page but i only know a few of the browser user agents. can you tell me the user agents for a few pda browsers. i allready know the user agent for pocket pc 2003 but i dont know the rest. also how do people make webpages that fit the screen of the pocket pc perfectly through html?
    ps. i would like the user agents like this:
    Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)
    if you would like to find out what your browser user agent is then go to http://dws05.ath.cx/Dev/bua/
    thanks, dandono
    Last edited by dandono; Apr 8th, 2005 at 01:07 PM.
    If there is only one perfect person in the universe, does that make them imperfect?

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: Browser user agent

    Does it matter what the browser user agent is? If all of them have the dimensions on the end: 240x320, isn't that all you need? If so, just parse that out and ignore the rest.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Browser user agent

    well i dont know how to do that. all can do is see if a user agent is equal to a string.
    If there is only one perfect person in the universe, does that make them imperfect?

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: Browser user agent

    There's probably a cleaner way to do it, but:

    PHP Code:
    <?php
        $userAgent 
    'Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)';

        
    $parts explode(';'$userAgent);
        
    $dimensions substr($parts[count($parts) - 1], 0strlen($parts[count($parts) - 1]) - 1);

        echo 
    $dimensions;
    ?>
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width