Advertisement
Guest User

Untitled

a guest
Feb 27th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. //include the database information
  3. include 'ipbdbauth.php';
  4.  
  5. $username = $_GET['u'];
  6. $passwordtemp = $_GET['p'];
  7. function userLoginIpb($username, $password) { //select the password information froms elected user
  8. $query = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT `members_pass_salt`, `members_pass_hash` FROM `members` WHERE `name` = '$username'");
  9. $results = mysqli_fetch_assoc($query);
  10. $hash = ['members_pass_hash'];
  11. //$password = md5(md5($results['members_pass_salt']).md5($password));
  12. //if($password == $results['members_pass_hash']) {
  13. //return true;
  14. //}
  15. //else {
  16. //return false;
  17. //}
  18. } //check if user is logged in
  19. Usage:
  20. if(userLoginIpb($username, $password))
  21. {
  22.  
  23. $nameresult = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM members WHERE name='$username'");
  24.  
  25. //fetch tha data from the database
  26. //while ($row = mysqli_fetch_array($nameresult)) {
  27. if (password_verify($password, $hash)){
  28. echo $row{'member_group_id'};
  29. }
  30. }
  31. else
  32. {
  33. echo 'Login Incorrect';
  34. }
  35. mysqli_close($dbhandle);
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement