Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. include("connection.php");
  3.  
  4. $mypass = crypt($_POST['pass'], '$2a$07$usesomesillystringforsalt$');
  5. $user=$_POST['user'];
  6.  
  7. $sql = $dbh->prepare("SELECT id FROM `users` WHERE pass=?");
  8. $dbh->beginTransaction();
  9. $sql->execute(array($mypass));
  10. $dbh->commit();
  11.  
  12. $count=$sql->rowCount($sql);
  13. echo $count;
  14. echo $mypass;
  15.  
  16. if($count==1){
  17. $_SESSION['user']=$user;
  18. $_SESSION['logged_in']=true;
  19. echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
  20. } else {
  21. $_SESSION['logged']="fail";
  22. echo '<META HTTP-EQUIV="Refresh" Content="2; URL=index.php">';
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement