Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. $sql_hote='localhost';
  3. $sql_db='db';
  4. $sql_user='utilisateur_db';
  5. $sql_password='motdepasse_db';
  6.  
  7. if(isset($_POST['user'], $_POST['pwd'], $_POST['uuid'])){
  8. try {
  9. $dbc=new PDO('mysql:host='.$sql_hote.';dbname='.$sql_db, $sql_user, $sql_password);
  10. $username=preg_replace("/[^a-zA-Z0-9]+/", "", $_GET['user']);
  11. $password=$_GET['password'];
  12. $selectStmt=$dbc->prepare('SELECT * FROM joueurs WHERE user_pseudo = :pseudo');
  13. $selectStmt->execute(array(':pseudo' => $username));
  14. $row=$selectStmt->fetch();
  15. unset($selectStmt,$dbc,$sql_hote,$sql_db,$sql_user,$sql_password);
  16. if($row) {
  17. if($row['user_mdp']==$password) {
  18. echo TRUE;
  19. exit();
  20. }
  21. else {
  22. echo FALSE;
  23. exit();
  24. }
  25. }
  26. else {
  27. echo FALSE;
  28. exit();
  29. }
  30. }
  31. catch(Exception $e) {
  32. echo FALSE;
  33. exit();
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement