How do you return the full URL I know if you do $url = "$REQUEST_URI"; it only returns what comes after the domain name but I want to know how to get it to return the full URL. For example if you go to http://www.hotch.org/john/url.php It returns /john/url.php how do i get it to return http://www.hotch.org/john/url.php ? Thanks
the below would output "http://www.hotch.org/john/url.php".
echo "http://" . $SERVER_NAME . $REQUEST_URI;
If you use this it will also pick up any query strings the url may have.
$URL = "http://yourwebsite.com";
if ($QUERY_STRING =="") { $QUERY_STRING = "$QUERY_STRING"; } else { $QUERY_STRING = "?$QUERY_STRING"; } echo "$URL$PHP_SELF$QUERY_STRING";