Well im getting pissed at this not working..
This is a script to look at there forum cookie (VBs) and make sure that the cookies correct. Then if it checks out, see if there in the correct forum group to look at this page (groups "5 6 7 9 10").
Well the first part works good, but the group check doesnt like doenst print or stop anyone.
thank you for any help
if(!isset($HTTP_COOKIE_VARS['bbuserid'])) {
echo '<center><B>Log in to the forum first!</B></center>';
exit;
}
$USERS_ID = $HTTP_COOKIE_VARS["bbuserid"];
$MD5_PASS = $HTTP_COOKIE_VARS["bbpassword"];
$connect_db; mysql_select_db("FORUM"); //Connect to forum DB
$user_sql = "SELECT `userid`,`password` FROM `user` WHERE 'userid'='$USERS_ID' AND 'password'='$MD5_PASS'";
$user_sql_result = mysql_query($user_sql, $connect_db) or die("<center><B>ERROR WITH SQL 1.</B></CENTER>" . mysql_error());
if(!$user_sql_result) {
echo ("<center><B>Your password and username dont match</B></CENTER>");
mysql_close();
exit;
}
$grp_sql = "SELECT `usergroupid`, 'userid' FROM `user` WHERE 'userid' = $USERS_ID";
$grp_sql_result = mysql_query($grp_sql, $connect_db);
while($grp_row = mysql_fetch_array($grp_sql_result)) {
if($grp_row[usergroupid] < '5' || $grp_row[usergroupid] == '8') {
echo "You are not in a Group that can view this page";
exit;
mysql_close();
}
}
echo '<p align=center>Hello "' . $grp_row[usergroupid] . '" Blah blah!<HR>';
mysql_close();