Answer the question
In order to leave comments, you need to log in
How to display an error in the authorization form with incorrectly entered data?
How to finish checking the login and password during authorization (should give an error - if the data is entered incorrectly)?
I have this code:
if(isset($_POST[login_admin]))
{
if($_POST[login] == $admins[login] || md5($_POST[password]) == $admins[password])
{
if(isset($_POST[me])) {$time = '900000000';} else {$time = '84000';}
setcookie('hash', md5($_POST[password]), time()+$time);
setcookie('login',$_POST[login], time()+$time);
header('Location: index.php');
}
}
Answer the question
In order to leave comments, you need to log in
if($_POST[login] == $admins[login] || md5($_POST[password]) == $admins[password])
if(isset($_POST[login_admin]))
{
if($_POST[login] == $admins[login] && md5($_POST[password]) == $admins[password]){
if(isset($_POST[me])) {$time = '900000000';} else {$time = '84000';}
setcookie('hash', md5($_POST[password]), time()+$time);
setcookie('login',$_POST[login], time()+$time);
header('Location: index.php');
}else{
echo 'Error';
}
}
I can't make an array with errors. Tell me how to do it in this case? *
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question