-
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
-
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.
-
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.
-
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], 0, strlen($parts[count($parts) - 1]) - 1);
echo $dimensions;
?>