Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <form action="welcome.php" method="post" role="form" id="login-form" autocomplete="off">
  2. <div class="form-group">
  3. <label for="acc" class="sr-only">Cuenta</label>
  4. <input type="text" name="acc" id="acc" class="form-control" placeholder="Usuario">
  5. </div>
  6. <div class="form-group">
  7. <label for="pass" class="sr-only">Password</label>
  8. <input type="password" name="pass" id="pass" class="form-control" placeholder="Contraseña">
  9. </div>
  10. <div class="checkbox">
  11. <span class="character-checkbox" onclick="showPassword()"></span>
  12. <span class="label">Mostrar contraseña</span>
  13. </div>
  14. <input type="submit" id="btn-login" class="btn btn-custom btn-lg btn-block" value="Ingresar">
  15. </form>
  16.  
  17. <?php
  18. require('db.php');
  19. class Usuario {
  20. function checkUser($acc, $pass){
  21. require('db.php');
  22. $data = array($acc, md5($pass));
  23. $stmt = $connection->prepare("SELECT count(*) FROM usuarios where desc_usuario = ? and password = ? ");
  24.  
  25. $result = $stmt->execute($data);
  26.  
  27. return $result;
  28. }
  29. }
  30. ?>
  31.  
  32. <?php
  33. error_reporting(E_ALL);
  34. ini_set('display_errors', 1);
  35. include('actions/db.php');
  36. include('actions/users/class_users.php');
  37. $acc = $_POST['acc'];
  38. $pass = $_POST['pass'];
  39.  
  40. $usr = new Usuario();
  41. $user = $usr->checkUser($acc, $pass);
  42. echo $user;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement