<?php session_start(); include '../class/userClass.php'; include '../class/securityClass.php'; use barlaKarime\userSystem as user; use barlaKarime\securitySystem as security; $user = filter_input(INPUT_POST, 'user'); $pass = filter_input(INPUT_POST, 'pass'); $userSystem = new user\userClass(); if ($userSystem->validate($user, $pass) === true) { //clase instanciada $security = new security\securityClass(); $security->login(); header('Location: ../menuPrincipal.php'); } else { header('Location: ../index.php?user=false'); }
<?php session_start(); include 'class/userClass.php'; use barlaKarime\userSystem as user; $userSystem = new user\userClass(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <form action="procesos/user.php" method="POST"> <input type="text" id="user" name="user" placeholder="digite usuario"> <br> <input type="password" id="pass" name="pass" placeholder="digite contraseña"> <br> <button type="submit">Validar</button> <?php if ($userSystem->errorUser() === false) { ?> <p>usuario y contraseña incorrectos</p> <?php } ?> </form> </body> </html>