Hi again,
Okay I have build my login system. Now I want the log process to know how is admin and not.
i.e
1 = deny
2 = user
3 = editor
4 = admin
5 = root // dangeres. heh
The above being stored in the database.
and so I had adden this to the login bit
// Check for permission and then redirect
if ($_SESSION["permission"] == '1')
{
header("Location: signup.php?error=1");
}
elseif ($_SESSION["permission"] == '2')
{
header("Location: page2.php");
}
elseif ($_SESSION["permission"] == '3')
{
header("Location: page3.php");
}
elseif ($_SESSION["permission"] == '4')
{
header("Location: page4.php");
}
elseif ($_SESSION["permission"] == '5')
{
header("Location: page5.php");
}
else
{
header("Location: signup.php?error=1");
}
}
It works but now if the user does not login currect becouse for some reasion the
else
{
header("Location: signup.php?error=1");
}
bit does not work.
What do you think is rung with it. The PHP Manual says
There may be several elseifs within the same if statement.
so what am I doing rung?
And secand do you think this is a secure way of doing it and if not what would be a better way of coding it? 🙂
Thanks again,
schumanna