PHP_SELF

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

$PHP_SELF only works if register globals is set to on (almost never these days).
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

bokehman wrote:$PHP_SELF only works if register globals is set to on (almost never these days).
and if it is turned on... it shouldn't be.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Something else to consider, if you leave the form action value blank, the form should post back to itself, so the action value is not necessary. There are also other way to get the page name rather than $_SERVER['PHP_SELF'], but a lot of that was already covered in this, and many other, thread(s).
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

leaving the form blank doesn't work in all browsers (or so I was told)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Yargh..
The Pirate wrote:Use a # sign, don't leave it blank.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

A dot (.) returns it to the IndexDocument of the current directory.
Post Reply