Hello
I´m trying to figure out how to make a login page that detects the "range of user" you are and depending on that you are redirected to different areas.
Here is what I've done
Any help and comments are appreciated.
What I did is create two queries. One for normal users and another one for administrator users. In case that you´re an Admin then you´re redirected with a conditional IF.
(I don´t know if my logic is or not logic)
validate.php-->
$ssql = "SELECT * FROM users WHERE User='$User' AND PWD='$PWD'";
$admin = "SELECT * FROM users WHERE User='$user' AND PWD='$PWD' WHERE range = SU";
$rs = mysql_query($ssql,$Conn);
if (mysql_num_rows($rs)!=0){
session_start();
session_register("autent");
$autent = "Yes";
if (mysql_query($admin));{
header ("Location: page1.php");
}else {
header ("Location: page2.php");
}else {
header("Location: login.php?wronguser=yes");
}
}
Thanx a lot