I want to take this:
<?php
while (list($key, $val) = each($HTTP_GET_VARS)) {
if (($key == "user_id") || ($key == "user_name") || ($key == "user_email") || ($key == "user_accessright1") || ($key == "user_accessright2") || ($key == "user_accessright3") || ($key == "user_accessright4")) {
echo "Don't cheat";
exit;
}
}
?>
and make it a bit more dynamic so that if I in the future are making changes in the userdatabase that it just works all the way round with only the one adjustment made to the database, here is what I whought would have worked:
<?php
$query_user = mysql_query("SELECT * FROM user WHERE user_id=1");
I would like the above query to not depend on a user, but just read all the field names in the user table, once.
while (list($key, $val) = each($HTTP_GET_VARS)) {
while ($userarray = mysql_fetch_assoc($query_user)) {
while (list($k, $v) = each($userarray)) {
if ((isset($key)) && ($key == $k)); {
echo "Don't cheat";
exit;
}
}
}
}
?>
The problem with this code is that whenever I put any variables at all in the address bar et somehow "finds a match".
I've tried echoing it all out to see if it reaaly finds a match, the var set in the URL was action=1, I wouldn't say that "action" is the same as "user_id".
Please help