Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //include the database information
- include 'ipbdbauth.php';
- $username = $_GET['u'];
- $password = $_GET['p'];
- function userLoginIpb($username, $password) { //select the password information froms elected user
- global $___mysqli_ston;
- $s = mysqli_real_escape_string($___mysqli_ston, $password);
- $query = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT `members_pass_salt`, `members_pass_hash` FROM `members` WHERE `name` = '$s'");
- $results = mysqli_fetch_assoc($query);
- $password = md5(md5($results['members_pass_salt']).md5($password));
- if($password == $results['members_pass_hash']) {
- return true;
- }
- else {
- return false;
- }
- } //check if user is logged in
- Usage:
- if(userLoginIpb($username, $password))
- {
- $nameresult = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM members WHERE name='$username'");
- //fetch tha data from the database
- while ($row = mysqli_fetch_array($nameresult)) {
- echo $row{'member_group_id'};
- }
- }
- else
- {
- echo 'Login Incorrect';
- }
- mysqli_close($dbhandle);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement