$PHP_SELF error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gbona

    #1

    $PHP_SELF error

    While running the following piece of code

    if (eregi("config. php",$PHP_SELF) ) {
    Header("Locatio n: 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
  • Tom Thackrey

    #2
    Re: $PHP_SELF error


    On 21-Oct-2003, Gbona <NOSPAMbgfra@ho tmail.com> wrote:
    [color=blue]
    > While running the following piece of code
    >
    > if (eregi("config. php",$PHP_SELF) ) {
    > Header("Locatio n: 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 ??[/color]

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    --
    Tom Thackrey

    tom (at) creative (dash) light (dot) com
    do NOT send email to jamesbutler@wil lglen.net (it's reserved for spammers)

    Comment

    • Charles E. Pelkey

      #3
      Re: $PHP_SELF error

      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" <NOSPAMbgfra@ho tmail.com> wrote in message
      news:Xns941D390 68359Bl@193.252 .19.141...[color=blue]
      > While running the following piece of code
      >
      > if (eregi("config. php",$PHP_SELF) ) {
      > Header("Locatio n: 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[/color]


      Comment

      Working...