Jump to content

Browser detection


birdie

Recommended Posts

Hi, i know $_SERVER['http_user_agent'] provides 'browser' detection but it just doesnt work simply.

Is there any way you can basically but this variable or another 1 which can do a relatively similiar action.

Example of the script

[code]
$browser = $_SERVER['http_user_agent'];
if(eregi('Firefox', $browser))
{
$sql = "UPDATE sitestats_browser SET firefox='$firefox'";
}
elseif(eregi('MSIE', $browser))
{
$sql = "UPDATE sitestats_browser SET ie='$internetexplorer'";
}
else
{
$sql = "UPDATE sitestats_browser SET other='$other'";
}
[/code]

Well this doesnt work because there are different versions of firefox.

Any help please?
Link to comment
https://forums.phpfreaks.com/topic/17086-browser-detection/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.