Detecting Browser
Moderator: General Moderators
-
DudeBori82
- Forum Commoner
- Posts: 26
- Joined: Thu Nov 18, 2004 10:09 am
- Location: Florida
Detecting Browser
Is there a way in PHP to detect what brand/version of browser the client is using? I need to make a way to redirect users of a specific browser to a specific site.
Really?
If javascript is the only way then the get_browser() function and $_SERVER['HTTP_USER_AGENT'] must be useless huh?
'HTTP_USER_AGENT'
Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.
http://us2.php.net/manual/en/function.get-browser.php

If javascript is the only way then the get_browser() function and $_SERVER['HTTP_USER_AGENT'] must be useless huh?
'HTTP_USER_AGENT'
Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.
http://us2.php.net/manual/en/function.get-browser.php