note 82583 added to reserved.variables
| From: | azmeerm at gmail dot com | Date: | Thu, 17 Apr 2008 09:25:39 +0000 |
| Subject: | note 82583 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138397@lists.php.net to get a copy of this message | ||
I wanted to know the current file name; and was breaking my head to figure out why I'm getting
a NULL for both $PHP_SELF and $_SESSION["PHP_SELF"] and even for
$_SESSION["SCRIPT_NAME"]. tried with 2 UNIX servers with no luck.
But when I used $_ENV["SCRIPT_NAME"] it worked !!
so here's a little snippet to find out what works.
echo "Current location= ".$PHP_SELF."<br>";
echo "Current location= ".$_SESSION["SCRIPT_NAME"]."<br>";
echo "Current location= ".$_SESSION["PHP_SELF"]."<br>";
echo "Current location= ".$_ENV["SCRIPT_NAME"]."<br>";
----
Server IP: 69.147.83.197
Probable Submitter: 123.231.21.239
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit -- https://master.php.net/note/edit/82583
Del: integrated -- https://master.php.net/note/delete/82583/integrated
Del: useless -- https://master.php.net/note/delete/82583/useless
Del: bad code -- https://master.php.net/note/delete/82583/bad+code
Del: spam -- https://master.php.net/note/delete/82583/spam
Del: non-english -- https://master.php.net/note/delete/82583/non-english
Del: in docs -- https://master.php.net/note/delete/82583/in+docs
Del: other reasons-- https://master.php.net/note/delete/82583
Reject -- https://master.php.net/note/reject/82583
Search -- https://master.php.net/manage/user-notes.php