Advertisement
Guest User

Untitled

a guest
May 30th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. security:
  2. encoders:
  3. FOSUserBundleModelUserInterface: bcrypt
  4.  
  5. <?php
  6. define('HOST','localhost');
  7. define('USER','root');
  8. define('PASS','');
  9. define('DB','swib');
  10.  
  11. $con = mysqli_connect(HOST,USER,PASS,DB);
  12.  
  13. $username = $_POST['username'];
  14. $password = $_POST['password'];
  15.  
  16. $password2=password_hash($password, PASSWORD_DEFAULT);
  17.  
  18. $sql = "select * from swib_user where username='$username' and password='$password2'";
  19.  
  20. $res = mysqli_query($con,$sql);
  21.  
  22.  
  23.  
  24. $check = mysqli_fetch_array($res);
  25.  
  26. if(isset($check)){
  27. echo 'success';
  28. }else{
  29. echo 'failure';
  30. }
  31.  
  32. mysqli_close($con);
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement