Collecting the user agent
Posted: Fri Apr 09, 2004 5:56 am
I have the following code that is suipposed to record the user agent of a visitor, but it does not show anything. I did not write this code, it comes from another stats script that I no longer have. Any suggestions as to why it does not work.
Code: Select all
function GetUserAgent() {
if (isset($_SERVER['HTTP_USER_AGENT']))
{
if ($_SERVER['HTTP_USER_AGENT'] != NULL)
{
$this->GetUserAgent = strtolower((string)$_SERVER['HTTP_USER_AGENT']);
}
else
{
$this->GetUserAgent = '';
}
}
else
{
$this->GetUserAgent = '';
}
}