I am working on a site that has a members area, and this members area has a vBulletin forum that is only accessible by members. I am trying to automatically login these users to the vBulletin forum when they login to the members area.
I've written some code to set the cookies 'bbuserid' and 'bbpassword', but it doesn't seem to be working. I am obviously missing something, but not sure what, and I am not sure where to look to find out.
This is what I have written to set the cookies...
Code:
if(!$result = mysql_query("SELECT userid, password FROM user WHERE username='".$_POST['vb_login_username']."'")) {
echo mysql_error();
exit;
}
if(mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$license_num = "...";
setcookie("bbuserid", $row['userid']);
setcookie("bbpassword", md5($row['password'].$license_num));
}
Any insight into why this isn't working would be GREATLY appreciated.
Thank you!