MySQL DB Test executed from ". $_SERVER['SCRIPT_NAME']. "\n";
print "Script name: ". $_SERVER['SCRIPT_FILENAME'] ."
\n";
while ($line = mysql_fetch_array($result))
{
print "$line[0]
\n";
}
mysql_close($link);
// try to open real /etc/passwd file
print "Trying to open /etc/passwd file
";
try2OpenFile("/etc/passwd");
// try to open real /etc/hosts file
print "Trying to open /etc/hosts file
";
try2OpenFile("/etc/hosts");
function try2OpenFile($file){
$f = @fopen($file, "r");
if ( !$f ) { print "Error - Cannot open file ".$file.""; return;}
echo "
File: $file
";
while ( $line = fgets($f, 1000) ) {
print $line;
}
echo "
";
}
?>