Re: $PHP_SELF or echo $PHP_SELF

From: Date: Thu, 14 Jul 2005 10:37:28 +0000
Subject: Re: $PHP_SELF or echo $PHP_SELF
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218667@lists.php.net to get a copy of this message
Hello Ross, Thursday, July 14, 2005, 11:11:25 AM, you wrote: R> Just a quick thing that is bugging me. In some of my older R> textbooks a form is returned to the same page by using R> echo $PHP_SELF no just $PHP_SELF R> is this just used in older versions of php?? Does the it make a R> difference what one is used? PHP_SELF is part of the $_SERVER super global, you should really access it like this: $_SERVER['PHP_SELF'] To answer your question though, it's just a variable - if you want to output it into your form action then you can do either: <? echo $_SERVER['PHP_SELF'] ?> or <?=$_SERVER['PHP_SELF']?> Either would work. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services "I do not fear computers. I fear the lack of them." - Isaac Asimov

« previous php.general (#218667) next »