Beginner PHP Question

Posted by user317128 on Stack Overflow See other posts from Stack Overflow or by user317128
Published on 2010-04-15T03:17:11Z Indexed on 2010/04/15 3:23 UTC
Read the original article Hit count: 290

Filed under:
|

I am working on an example from a php book and am getting an error on line 8 with this code

<?php

$agent = getenv("HTTP_USER_AGENT");
if (preg_match("/MSIE/i", "$agent"));
{
    $result = "You are using Microsoft Internet Explorer";
}
else if (preg_match("/Mozilla/i", "$agent")); 
{
    $result = "You are using Mozilla firefox";
}
else {$result = "you are using $agent"; }

echo $result;


?>

© Stack Overflow or respective owner

Related posts about php

Related posts about php5