Hi
Can anyone help me find what's wrong with the following bit of code?
Background info:
Each page has an array holding values of access levels required for entry.
A table in the db holds all members access levels.
e.g.
joannew member
joannew webadmin
etc
I have a function which gets all the authlevels of the user and checks them against the values in the array on the page they are trying to access.
(hope this makes sense, sorry it's a bit long winded)
anyway, there's something wrong with this bit of code, and I can't
for the life of me figure it out.
$num_auth = mysql_num_rows ($result);
//check their authorisation against the page access
$entry = 'false';
for ($i=0; $i<count($access); $i++)
{
for ($j=0; $j<$num_auth; $j++)
{
//if we find a record, get value of auth
$row = mysql_fetch_array($result);
$authlevel = $row->authlevel;
echo "$auth";
if ($authlevel == $access[$i])
{
$entry = 'true';
}
} //end 2nd for
} //end ist for
Thanks in advance,
Jo