|
-
Apr 8th, 2005, 08:35 AM
#1
Thread Starter
Hyperactive Member
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?
-
Apr 11th, 2005, 11:36 AM
#2
Stuck in the 80s
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.
-
Apr 11th, 2005, 01:05 PM
#3
Thread Starter
Hyperactive Member
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?
-
Apr 12th, 2005, 08:59 AM
#4
Stuck in the 80s
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;
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|