I have created a login page .
In the mysql database I have a table "users" and in that table there is a column called "stichting", for example a record holds NBS in that column.
Now in the code at the login page, it should check after a person logs in what name is put into the "stichting" column, if it is NBS the user should be redirected to a page, if it is something else, say: VMB, and the user has it the column that the user should be redirected to the VMB page instead of the other page.
If nothing is found, the user should get a message that he or she has no access.
Here is the code I have sofar, I tried to login with a username with which I know has VMB in its (stichting) column, but still I get redirected to the other page.
<?php
$red = mysql_query("SELECT * FROM users where name='".$naam."' AND stichting = 'NBS' LIMIT 1") or die(mysql_error());
if(mysql_num_rows($red) == "NBS") {
echo "<a href='contact_nbs28BsY29Lm4'>Ga door naar de volgende pagina</a>";
}
elseif(mysql_num_rows($red) == "VMB") {
echo "<a href='contact_vmbkYe293NB'>voorbeeld pagina</a><br />";
echo "<a href='logout.php'>uitloggen</a><br />";
}
else{
echo "geen toegang";
}
?>
<?php
Hope someone can help me.