i have some code that when ever you click the link it opens the file just in that table and not another page. I can get it to wprk when i try to make it a little more secure this is the code....
<?
echo "
<table border=1>
<tr>
<td width=100>
<a href=index.php?page=test.html>Test</a>
<br>
<a href=index.php?page=test2.html>Test 2</a>
<td>
";
function safe($page) {
if (!eregi("..",$page) AND !eregi(".\",$page))
{
$page = getenv('DOCUMENT_ROOT') . "/home/brooks/public_html/$page";
return $page;
} else {
print "<p>WARNING - You are not allowed access to this area.
</p>";
exit;
}
include(safe($page));
?>
I always get an error on the
$page = getenv('DOCUMENT_ROOT') . "/home/brooks/public_html/$page";
i cant figure it out, if there is something that i forgot to close or if my scrit[ing isnt right. please help if you can. Any help is greatly appreciated..
Brooks