Please could someone tell me where the URL of a particular page is stored so
that I can access it from PHP?
For example, I want to create a generic index.php that prints the URL that
you typed in to get there. If you type "www.mysite.com" in the browser, you
get a page that says "welcome to www.mysite.com".
Cheers,
Ben
$HTTP_SERVER_VARS["HTTP_HOST"] should hold the domain name variable ie.
www.bla.com
If you want the path to the file as well, then append it with $PHP_SELF
which holds '/folderbla/bla.php'
All these variables can be found in phpinfo. Load a PHP file onto your
server with
<?php
phpinfo();
?>
in it, and then run from your browser.
Hope this helps.
http://www.php.net/manual/en/reserved.variables.php
and take a look at 'HTTP_REFERER'
Happy coding.
E.