$PHP_SELF is a global variable that's ONLY available if you have "register_globals = on" set in your PHP configuration (php.ini). This variable should be accessed via $_SERVER['PHP_SELF'].
That said, PHP_SELF is a string that contains the relative URL path of the script being executed. The most common use for it is to insert PHP_SELF into links or form actions to direct the user to the same page they are leaving.
Scripts that generate a form generally receive that form's input, so that if any validation steps fail, it can simply be triggered to regenerate the form.
It's useful to have links return to the same page that you just left for a multitude of reasons. Take, for example, a table of data that you'd like to sort by various columns. Each column header is a link to the same page specifying the column by which to sort.
For more info, read the register_globals FAQ and the manual page about reserved variables.
http://p2p.wrox.com/archive/beginnin...2002-11/17.asp
http://www.php.net/reserved.variables
http://www.php.net/variables.predefined
Take care,
Nik
http://www.bigaction.org/