Answer the question
In order to leave comments, you need to log in
How to display alert and redirect?
How to make first echo in which js code (in my case, alert with information about incorrect login or passwords) and then redirect to the authorization page (login.php)
Tried like this but an error
if($login == $adminLogin AND $pass == $adminPass)
{
$_SESSION['admin'] = true;
header("Location: index.php");
exit;
}
else
{
echo '<script>alert("Логин и/или пароль неверны!");</script>';
header("Location: login.php");
exit;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question