<?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>
views:
39answers:
2
+2
A:
Might I venture a guess, and suggest that:
<?php "<p>$result</p>";?>
Should be:
<?php echo "<p>$result</p>";?>
Wrikken
2010-07-19 17:38:04
Oh yeah I missed that :)
kemp
2010-07-19 17:38:52
hey Wrikken u r freaking awesome...i wonder for how much time have u been into PHP.i misread from the book :P
Rookie9
2010-07-19 17:42:58