Hi!
I have a competition running on my web page which requires the users to login. The login information is currently checked across a phpbb2 forum. Then new cookies are set outside phpbb2 to remember the user is logged in. Actually what I do is just check if the login information is correct from the phpbb2 forum. That's all.
No I'm trying to make it work for vb3 but I don't know how although I have read several posts.
Your help would be very much appreciated.
Here is the code for phpbb2 I'm currently using ($userid,$pwd are taken from user input from a login forum):
Code:
function CheckUserLogin($userid, $pwd) {
global $dbaseUserData, $User, $useEncryption;
// if encryption enabled encrypt the password
if ($useEncryption == TRUE) {
$pwd = md5($pwd);
}
// Default the login to false.
$User = new User;
$User->loggedIn = FALSE;
$User->usertype = 1;
$link = OpenConnection();
if ($link == FALSE) {
return FALSE;
}
$userquery = "SELECT * FROM phpbb_users where username = \"$userid\"";
$userresult = mysql_query($userquery)
or die("Query failed: $userquery");
if ($userline = mysql_fetch_array($userresult, MYSQL_ASSOC)) {
if ($pwd == $userline["user_password"]) {
// The passwords are equal. Log the user in, and update the
// data.
$User->userid = $userid;
$User->pwd = $pwd;
}
}
return TRUE;
}
}
CloseConnection($link);
return FALSE;
}