Hi,
Just wondering how I can get the url of the page that a script is running on. for example if page http://www.mysite/test.php were to be executed the output would be the text: http://www.mysite/test.php.
thanks
Hi,
Just wondering how I can get the url of the page that a script is running on. for example if page http://www.mysite/test.php were to be executed the output would be the text: http://www.mysite/test.php.
thanks
Found it the answer just now. The following will print the relative url:The following will display the complete url:Code:<?php print $_SERVER['REQUEST_URI']; ?>
The following will give you all the info that you need:Code:<?php print $_SERVER['SCRIPT_URI']; ?>
Code:<?php print var_dump($_SERVER); ?>
Last edited by james438; 01-14-2008 at 08:12 AM. Reason: for clarification.
Bookmarks