DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Check IPB User Credientials With PHP
I was recently writing a script that needed to interact log users in only if they had registered on an IPB 3 forum, and I couldn't find any tips on how to go about it. You may have to edit the table in the query if you have a table prefix.
function userLoginIpb($user, $password) {
$query = mysql_query("SELECT `members_pass_salt`, `members_pass_hash`
FROM `members`
WHERE `name` = '$user'");
$results = mysql_fetch_assoc($query);
$password = md5(md5($results['members_pass_salt']).md5($password));
if($password == $results['members_pass_hash']) {
return true;
}
else {
return false;
}
}
Usage:
if(userLoginIpb($username, $password)) {
echo 'logged in';
}





