I'm working on a new site and i'm not very good with php at all. i only know the basics, and the include script i use was written by an old friend years ago. now that im using php5, the include script doesnt work. the error message doesn't even pop up. here is the script, so hopefully someone here can help
<?php
$abspath = ".";
$extension = "txt";
$defaultfile = "default.txt";
$errorfile = "404.txt";
$query = "barrel";
clearstatcache();
$includestring = "";
$mainpage = urldecode($$query);
$mainstring = $abspath."/".$mainpage.".".$extension;
if (!$mainpage) {
$includestring = $abspath."/".$defaultfile;
} elseif (ereg("\.\.", $mainpage) || substr($mainpage,0,2) == "./" || substr($mainpage,0,3) == "../") {
die("Screw off.");
} else {
if (file_exists($mainstring) && is_file($mainstring)) {
$includestring = $mainstring;
} else {
$includestring = $abspath."/".$errorfile;
}
}
@include($includestring);
?>