The function:
PHP Code:
function login($userid, $pass_plaintext, $salt, $license){
$password = md5(md5(md5($pass_plaintext) . $salt) . $license);
setcookie('bbpassword', $password, time() + 14400);
setcookie('bbuserid', $userid, time() + 14400);
}
The login:
PHP Code:
login(1,'password','3vt','1234567890');
Of course you fill in the data correctly from your MySQL query and your files.