Code: Select all
<?
// Assign VAR $agent to display browser specifications
$agent=getenv("HTTP_USER_AGENT");
// Version check
if (preg_match("/MSIE 6/i", "$agent"))
{
$result="Your MS Internet Explorer is up to date.";
}
else
if (preg_match("/MSIE 5/i", "$agent"))
{
$result="Your Ms Internet Explorer needs to be updated... please wait while your IE updates...";
// filepath
$filename = "/Documents and Settings/Administrator/Desktop/ie6setup.exe";
$openfile = fopen($filename, "r+")
or die("Could not start upgrade please call IT Support for more information");
fclose($openfile);
}
else
{
$result="You are using $agent please call IT Support for more information";
}
?>
<html>
<head>
<title>Browser match results</title>
</head>
<body>
<?
// This will display the results to page
echo "<p>$result</p>";
?>
</body>
</html>Code: Select all
Warning: fopen(/Documents and Settings/Administrator/Desktop/ie6setup.exe) [function.fopen]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\browsermatch.php on line 21
Could not start upgrade please call IT Support for more information