Advertisement
Guest User

Untitled

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