[thelist] Basic PHP question about: 'Notice: Undefined variable'

Jens Brueckmann jens.brueckmann at gmail.com
Thu Aug 10 14:01:54 CDT 2006


Hi Chris,

> Notice: Undefined variable: PHP_SELF in e:\Websites\xxxx\admin\login.php on
> line 12
>
> The code on line 12 is:  $FF_LoginAction = $PHP_SELF;

It seems that your client's server is configured not to use global variables.
$PHP_SELF is one of those global variable in PHP.
For security reasons these variables are not registered by default
since PHP 4.2.0.

Nowadays, superglobals should be used instead of global variables, in
your case the $_SERVER array:

  $FF_LoginAction = $_SERVER["PHP_SELF"];

For more information on predefinded variables an security in PHP see

http://de2.php.net/manual/en/language.variables.predefined.php
http://de2.php.net/manual/en/reserved.variables.php
http://de2.php.net/manual/en/security.globals.php

Cheers,

jens

-- 
Jens Brueckmann
http://www.yalf.de



More information about the thelist mailing list