Hi. The "cannot modify header information" error is likely showing because of the onscreen printing of the "undefined index" errors. The "undefined index" errors are showing because $_SERVER['SCRIPT_FILENAME'] and $_SERVER['REQUEST_URI'] are not recognized. From
php.net is the following:
$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the webserver. There is no guarantee that every webserver will provide any of these; servers may omit some, or provide others not listed here. That said, a large number of these variables are accounted for in the CGI 1.1 specification, so you should be able to expect those.
One thing to try is to replace:
PHP Code:
if (eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {
with the following:
PHP Code:
if (eregi("config.php",$_SERVER['SCRIPT_NAME'])) {