quote:
Originally posted by MeEtc
I do know that $_SERVER['REQUEST_URI'] contains the full url, but it is not cross platform. (*cough* IIS *cough*)
Code stolen from WordPress...
code:
// Fix for IIS, which doesn't set REQUEST_URI
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?
// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
REQUEST_URI won't contain the hostname though... you can get that from HTTP_HOST.