Page 1 of 1

Cannot Detect Current URL - hep me! hep me!

Posted: Sat Oct 12, 2002 12:52 pm
by gilliepit
The first part of my script doesn't seem to be running:

Code: Select all

<?
    $url = "http://" . $HTTP_HOST . $SCRIPT_NAME;
?>
When the variable is echoed, the output is 'http://'

What could be causing this to not detect the host and script and place it into the variable? ( I know it's simple, but the simple things seem to be the most frustrating.. no? :wink: )

Posted: Sat Oct 12, 2002 12:59 pm
by hob_goblin

Posted: Sat Oct 12, 2002 12:59 pm
by volka
probably a php-version related problem. then try

Code: Select all

&lt;?php $url = "http://" . $_SERVER&#1111;'HTTP_HOST'] . $_SERVER&#1111;'PHP_SELF']; ?&gt;

Posted: Sat Oct 12, 2002 1:03 pm
by gilliepit
volka - thanks, I suppose it was a version issue, your code worked fine..

awesome turnaround, I believe I had to wait all of 10 minutes? maybe?

you guys rock :D