Hi,
I´d like to redirect to an url when the user clicks the Cancel option in an HTTP Authentication.
The code:
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="Acceso restringido"');
header('HTTP/1.0 401 Unauthorized');
$host = $SERVER['HTTP_HOST'];
$uri = rtrim(dirname($SERVER['PHP_SELF']), '/\');
$extra = 'indice.php';
//echo "Location: http://$host$uri/$extra";
//HERE I WANT TO REDIRECT
exit;
}
I´ve tested with header("Location: http://$host$uri/$extra"); but it doesn´t work.
Another thing I´d like to know is if this login method is secure or not.
Thanks!