views:

39

answers:

2
<?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 Firefox.";}
    else {$result = " you are using $agent.";}

?>
<html>
<head>
<title>Browse Match Results</title>
</head>
<body>
<?php "<p>$result</p>";?>
</body>
</html>
+2  A: 

Might I venture a guess, and suggest that:

<?php "<p>$result</p>";?>

Should be:

<?php echo "<p>$result</p>";?>
Wrikken
Oh yeah I missed that :)
kemp
hey Wrikken u r freaking awesome...i wonder for how much time have u been into PHP.i misread from the book :P
Rookie9
A: 

<?php echo "<p>$result</p>";?>

Col. Shrapnel