I want obtain full URL adres in php script, tell please, this code always give correct URL?
or maybe in some case, this code give us wrong URL ?
if (empty($_SERVER['HTTPS'])) {
$s = "";
}
else {
$s = "s";
}
$url = "http".$s."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
You forget port number. This is full function code to receive current page URL.