Hi if i use the below code to authicate weather or not a user can enter a part of the site or not, what would i have to add/do to it so that it looks for the UsersID in the cookie then takes that back to the script and then gets the UsersType and if it is limited then the script dies.
$connection = mysql_connect($db_host, $db_username, $db_password) or die("Unable to connect to database");
mysql_select_db($db_name, $connection) or die("Unable to select database $db_name");
$sqlquery = "SELECT type FROM users";
$result = mysql_query($sqlquery, $connection);
mysql_num_rows($result);
$row = mysql_fetch_assoc($result);
if ($row['type'] == 'limited') {die("<html><head><title>Redirecting...</title><BODY><script language=\"Javascript\">window.location=\"admin.php\"</script>Redirecting...</BODY></HTML>"); };
mysql_close ();