Advertisement
Guest User

Untitled

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