Calling script name ...

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-20-2004
Ruby Tuesday
 
Posts: n/a
Default Calling script name ...

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.


Reply With Quote
  #2 (permalink)  
Old 01-21-2004
mar
 
Posts: n/a
Default Re: Calling script name ...

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.
>
>



Reply With Quote
  #3 (permalink)  
Old 01-25-2004
Bryan Chan
 
Posts: n/a
Default Re: Calling script name ...

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.
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:36 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0