Re: differences in between these env. variables
| From: | Tedd Sperling | Date: | Sun, 29 Jan 2012 16:38:00 +0000 |
| Subject: | Re: differences in between these env. variables | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316424@lists.php.net to get a copy of this message | ||
On Jan 27, 2012, at 12:45 PM, Adam Richardson wrote:
> On Fri, Jan 27, 2012 at 12:09 PM, Tedd Sperling <tedd.sperling@gmail.com> wrote:
> On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote:
>
> > Is there ever a case where SCRIPT_NAME does not equal PHP_SELF?
>
> Was this every answered? I would like to know.
>
> Cheers,
>
> tedd
>
> Yep, can be different:
>
> http://stackoverflow.com/questions/279966/php-self-vs-path-info-vs-script-name-vs-request-uri
>
> Adam
I should have been more clear -- I understand:
[PHP_SELF] => /test.php/foo/bar
[SCRIPT_NAME] => /test.php/
by practice is different.
I should have used basename() in my question.
The main point I was trying to get was which one is more secure and not subject to cross-site
scripting or other such security issues?
IOW, if you had to bet your life on it, which would be most secure in reporting an accurate
basename()?
Cheers,
tedd
_____________________
tedd@sperling.com
http://sperling.com