Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $base = new PDO("mysql:host=localhost;dbname=pruebas;charset=utf8","root","root");
- $base->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
- $sql = "select * from usuarios_pass where usuario = :login and password = :password";
- $resultado = $base->prepare($sql);
- $login = htmlentities(addslashes($_POST['login']));
- $password = htmlentities(addslashes($_POST['password']));
- $resultado->bindValue(":login",$login);
- $resultado->bindValue(":password",$password);
- $resultado->execute();
- if ($resultado->rowCount() !=0){
- //echo "usuario registrado";
- }else{
- header ('location:login.php');
- }
- } catch (Exception $e) {
- die ("Error al conectar" . $e->getMessage());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement