Hi All,
What is the difference between $_SERVER['SCRIPT_NAME'] and
$_SERVER['PHP_SELF'], and which is better to use?
According to the CGI 1.1 spec (http://hoohoo.ncsa.uiuc.edu/cgi/env.html),
SCRIPT_NAME is not something specific to Apache (if I understand that
correctly). But where does PHP_SELF come from? What creates that?
According to http://php.net/reserved.variables, PHP has no control over the
$_SERVER array. Quote:
"The entries in this array are created by the webserver. There is no
guarantee that every webserver will provide any of these; servers may omit
some, or provide others not listed here. That said, a large number of these
variables are accounted for in the CGI 1.1 specification, so you should be
able to expect those."
So, of those two, should I be concerned about one being less portable than
the other, or that one might change in the future?
Thanks!
Sincerely,
-Josh