mirror of
https://github.com/FranP-code/Login-Form.git
synced 2025-10-12 23:52:47 +00:00
Logica y conexion con la base de datos hecha
This commit is contained in:
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user