Advertisement
Guest User

Untitled

a guest
Apr 13th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. if(isset($_POST['login'])){
  2.  
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5. $pc = md5($password);
  6.  
  7. $req = $pdo->prepare('SELECT * FROM users WHERE nom= :username AND pass= :password');
  8. $req->execute(array(
  9. 'username' => $username,
  10. 'password' => $pc,
  11. ));
  12.  
  13. if ($user = $req->fetch()) {
  14. $_SESSION['auth'] = $user;
  15. header("location:home.php");
  16. exit();
  17.  
  18. }
  19.  
  20. else{
  21. echo"<script> alert('LE NOM D UTILISATEUR OU LE MOTS DE PASSE INCORRECTE')</script>";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement