Guest User

Untitled

a guest
Mar 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. session_start();
  2.  
  3. require 'connexion.php';
  4.  
  5. $log = $con->prepare("SELECT ID FROM users WHERE (user = :user OR email = :email) AND password = :password");
  6. $log->bindParam(':user', $data);
  7. $log->bindParam(':email', $data);
  8. $log->bindParam(':password', $pass);
  9.  
  10. $log->execute();
  11.  
  12. $count = $log->rowCount();
  13. $dt = $log->fetch(PDO::FETCH_OBJ);
  14.  
  15. $con = null;
  16.  
  17. if ($count == 1){
  18.  
  19. $_SESSION["user_id"] = $dt->ID;
  20. header('Location: http://***.***/index.php');
  21.  
  22. } else {
  23.  
  24. echo "Fail Epic";
  25.  
  26. }
  27.  
  28. die("Epic Fail: " . $e->getMessage());
Add Comment
Please, Sign In to add comment