Unexpected T_ELSE error in PHP

Posted by Jacksta on Stack Overflow See other posts from Stack Overflow or by Jacksta
Published on 2010-04-15T03:17:11Z Indexed on 2010/04/15 9:13 UTC
Read the original article Hit count: 179

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