Funny you mention that. I originaly wrote the code with the ereg function, just as you did and the same problem. I am using php4 and, so I was advised to try preg_match. Both provide me with errors. Hmm...
Like this you say..
<?
error_reporting(1023);
/MSIEliesaboutitsname/
if(ereg("MSIE",$HTTP_USER_AGENT))
{
$Browser_Name="MSIE";
}
if (ereg("5.0", $HTTP_USER_AGENT)) {
$Browser_Version ="5.0";
}
if(ereg("Mac",$HTTP_USER_AGENT))
{
$Browser_Platform="Macintosh";
}
if ( (strcmp($Browser_Platform,"Macintosh)) && (strcmp($Browser_Name,"MSIE")) && (strcmp($Browser_Version,"5.0")) ) {
print("this browser sucks");
}else{
print("not IE 5");
}
?>