By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

$PHP_SELF error

P: n/a
While running the following piece of code

if (eregi("config.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}

I get the following error

Notice: Undefined variable: PHP_SELF in c:\nuke\config.php on line 92

Why ?
PHP_SELF always worked in other scripts

Who can help me ??

Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

On 21-Oct-2003, Gbona <NO*********@hotmail.com> wrote:
While running the following piece of code

if (eregi("config.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}

I get the following error

Notice: Undefined variable: PHP_SELF in c:\nuke\config.php on line 92

Why ?
PHP_SELF always worked in other scripts

Who can help me ??


http://www.php.net/manual/en/configu...gister-globals

--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

P: n/a
Like Tom said, read up on register globals.
To fix this (as it appears to be php-nuke code you pasted in, place the
following line in either config.php or mainfile.php:

$PHP_SELF = $_SERVER["PHP_SELF"];

HTH,
Charles
"Gbona" <NO*********@hotmail.com> wrote in message
news:Xn***************@193.252.19.141...
While running the following piece of code

if (eregi("config.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}

I get the following error

Notice: Undefined variable: PHP_SELF in c:\nuke\config.php on line 92

Why ?
PHP_SELF always worked in other scripts

Who can help me ??

Thanks

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.