This is a discussion on Calling script name ... within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Suppose I have a web url: http://some/site/script.php?value1=x&value2=y&value3=z how ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Suppose I have a web url:
http://some/site/script.php?value1=x&value2=y&value3=z how do I view what's the calling scripts, e.g it should return scripts.php or with the full-pathname. Thanks. |
|
|||
|
Try to read the global variable $HTTP_ENV_VARS.
There is an element, SCRIPTNAME, where PHP store its executed script in. Try this and you'll find what you need. <? print "<pre>"; print_r($GLOBALS); print "</pre>"; ?> Good luck. Mespulien "Ruby Tuesday" <rubytuzdayz@yahoo.com> schreef in bericht news:bukabd$it1gk$1@ID-205437.news.uni-berlin.de... > Suppose I have a web url: > > http://some/site/script.php?value1=x&value2=y&value3=z > > how do I view what's the calling scripts, e.g it should return scripts.php > or with the full-pathname. > > Thanks. > > |
|
|||
|
I don't know what version of PHP you are using; I am not sure whether I
should suggest $HTTP_SERVER_VARS or $_SERVER. Anyways, the following would work for all versions. print getEnv("SCRIPT_NAME"); // relative path to DOCUMENT_ROOT print getEnv("SCRIPT_FILENAME); // absolute path on server Bryan "Ruby Tuesday" <rubytuzdayz@yahoo.com> wrote in message news:bukabd$it1gk$1@ID-205437.news.uni-berlin.de... > Suppose I have a web url: > > http://some/site/script.php?value1=x&value2=y&value3=z > > how do I view what's the calling scripts, e.g it should return scripts.php > or with the full-pathname. > > Thanks. > > |