Jump to content

$_SERVER["SCRIPT_NAME"] from another file


Niels

Recommended Posts

Hey everyone! I have a question,

 

I need to request the current URL of the page, i currently use $_SERVER["SCRIPT_NAME"].

This works fine if it needs the url of the file it is in, but  i need the url from another file (its too complicated to explain) For example i have two files called "Profile.php" and "urlreq.php", i need to echo the full url of Profile.php in urlreq.php. $_SERVER["SCRIPT_NAME"] won't work because that will get  the url of urlreq.php, the file the code is currently in.

 

I hope i explained it clearly enough 

Thanks in advance,

 

Niels.

Link to comment
https://forums.phpfreaks.com/topic/252202-_serverscript_name-from-another-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.