<?php
// in chroot use mysql host IP 127.0.0.1
// if you want to use localhost put /etc/resolve.conf /etc/hosts file
// to /webroot/etc directory
$query = "show tables";
print "<h1>MySQL DB Test executed from ".
$_SERVER['SCRIPT_NAME'].
"</h1>n";
print "Script name: ".
$_SERVER['SCRIPT_FILENAME'] .
"<hr>n";
{
}
// try to open real /etc/passwd file
print "<h1>Trying to open /etc/passwd file</h1>";
try2OpenFile("/etc/passwd");
// try to open real /etc/hosts file
print "<h1>Trying to open /etc/hosts file</h1>";
try2OpenFile("/etc/hosts");
function try2OpenFile($file){
if ( !
$f ) { print "Error - Cannot open file <b>".
$file.
"</b>";
return;
}
echo "<hr>File: $file<hr><pre>";
while ( $line =
fgets($f,
1000) ) {
}
}
?>