Forum Moderators: coopster

Message Too Old, No Replies

Displaying the URL on a page with PHP?

         

Linda_A

1:23 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



Is it possible to use PHP to display the URL of a page on the page itself? I am currently using SSI to do this, but I am looking at switching over to PHP.

WhosAWhata

2:17 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



echo $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];

something like that should work (it will change if you type www.SITE.com/file.php or just SITE.com/file.php in the browser)

Linda_A

10:36 am on Jun 24, 2004 (gmt 0)

10+ Year Member



Thanks, that was just what I needed. :)