NYCPHP Meetup

NYPHP.org

[nycphp-talk] $_SERVER['PHP_SELF'} not working?

Dan Cech dcech at phpwerx.net
Thu Jul 21 10:16:48 EDT 2005


George Schlossnagle wrote:
> My example was flawed, but the same case still works.  Apache allows  
> the use of '/' as an IFS, so you can do
> 
> http://www.example.com/index.php/$BAD_STUFF_HERE and it will appear  
> in full form in PHP_SELF.

You are absolutely correct, I hadn't thought of that case either.

Would it make more sense to use the $_SERVER['SCRIPT_NAME'] variable?

> $_SERVER["QUERY_STRING"]   no value
> $_SERVER["REQUEST_URI"]    /info.php/hello=tiger
> $_SERVER["SCRIPT_NAME"]    /info.php
> $_SERVER["PATH_INFO"]      /hello=tiger
> $_SERVER["PHP_SELF"]       /info.php/hello=tiger

Dan



More information about the talk mailing list