Hi,
if i use...
// php
$info = getenv("HTTP_US ER_AGENT");
// I noticed that Mozzila and Netscape <6(?) both use the same Agent.
// so i was thinking of
if (preg_match("/Mozilla/i", $info)) {
if (preg_match("/rv:/i", $info)) { $web = "Mozilla"; }
else
if (preg_match("/Mozilla\/3/i", $info)) { $web = "Netscape 3.x"; }
else
if (preg_match("/Mozilla\/4.5/i", $info)) { $web = "Netscape 4.5"; }
else
if (preg_match("/Mozilla\/4.6/i", $info)) { $web = "Netscape 4.6"; }
else
if (preg_match("/Mozilla\/4.7/i", $info)) { $web = "Netscape 4.7"; }
else
if (preg_match("/Mozilla\/4/i", $info)) { $web = "Netscape 4.x"; }
else
{ $web = "Mozilla"; }
}
Is the code above correct or is there a better way of doing it?
Regards
Sims