Logica y conexion con la base de datos hecha

This commit is contained in:
2021-05-20 22:08:31 -03:00
parent 9b934b2c95
commit 9b8a533548
7 changed files with 75 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
require 'messages.php';
require 'sanitize.php';
require './sql/querys.php';
$user = $_POST['user'];
$password = $_POST['password'];
@@ -14,7 +15,19 @@ if (isset($_POST['submit'])) {
if(strlen($password) <= 20){
sanitize('user', $user);
$c = verifyDB($user, $password);
if ($c[0][1] === $user && $c[0][2] === $password) {
echo '<script>
window.location.replace(`../success-pages/loginS.html`)
</script>';
} else {
echo error('The User or the Password are wrong. Please try again');
echo backToPreviusPage(4, '../login.html');
}
} else {
echo error('The password has more characters than allowed!');