HTTP HEADERS
I was wondering what the enviromental variable for perl/php is for the current url? For example getenv(QUERY_STRING); gives you the query string, what gives you the actuall url?
I was wondering what the enviromental variable for perl/php is for the current url? For example getenv(QUERY_STRING); gives you the query string, what gives you the actuall url?
Maverick posted this at 17:44 — 20th August 2000.
They have: 334 posts
Joined: Dec 1999
There isn't an easy way. You'll need to combine the $HTTP_HOST and $REQUEST_URI into a single URL string.
Try:
<?php
$full_url = sprintf("%s%s%s","http://",$HTTP_HOST,$REQUEST_URI);
echo "$full_url";
?>
Mark Hensler posted this at 19:59 — 20th August 2000.
He has: 4,048 posts
Joined: Aug 2000
simpler...
<?
print "http://" . $HTTP_HOST . $REQUEST_URI;
?>
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.