Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. if($submit)
  2. {
  3. $first=$_POST['first'];
  4. $password=$_POST['password'];
  5. $hash="*85955899FF0A8CDC2CC36745267ABA38EAD1D28"; //this is the hashed password i got by using function PASSWORD in database
  6. $password=password_verify($password,$hash);
  7. $db = new mysqli("localhost", "root","","learndb");
  8. $sql = "select * from admin where username = '" . $first . "' and password = '". $password . "'";
  9. $result = $db->query($sql);
  10. $result=mysqli_num_rows($result);
  11.  
  12.  
  13. if($result>0)
  14. {
  15.  
  16. session_start();
  17. $_SESSION['logged_in'] = true;
  18. session_regenerate_id(true);
  19. header("Location:loginhome.php");
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement