Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $login=htmlentities(addslashes($_POST["login"]));
- $password=htmlentities(addslashes($_POST["password"]));
- $contador=0;
- $base=new PDO("mysql:host=localhost; dbname=gesyagro" , "alejo", "15898920");
- $base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql="SELECT * FROM documentacion_usuario WHERE DocUsuario= :login";
- $resultado=$base->prepare($sql);
- $resultado->execute(array(":login"=>$login));
- while($registro=$resultado->fetch(PDO::FETCH_ASSOC)){
- /*echo "Usuario: " . $registro['DocUsuario'] . " Contraseña: " . $registro['DocContrasena'] . "<br>";
- }*/
- if (password_verify($password, $registro['DocContrasena']))
- {
- $contador++;
- }
- }
- if ($contador>0) {
- echo "Bienvenido";
- //header("location: contenido.php");
- }else{
- header("location: Registro.html");
- }
- $resultado->closeCursor();
- }catch(Exception $e){
- die("Error: " . $e->getMessage());
Add Comment
Please, Sign In to add comment