I have a question..
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL.'?app_not_found';
}
Through the function I am fetching the current URL .... now I have two conditions
if($databaseAppVersion == $appVersionName)
{
//echo curPageURL();
header('Location: '.curPageURL());
}
else
{
$url ="www.google.com";
//echo $url;
header('Location: '.$url);
}
when I am printing them the echo is happening but the problem is that the it does not redirection me to the intended page ... on the first condition I want to redirect to the current page having a message i.e. localhost/test/index.php?app_not_found but this is not happening