How do I allow both user and administrator to login through the same page but redirect to different pages using slim php and mysql database e.g
if(sid = 0) {
//redirect to admin dashboard}
else if (sid = 1) {
//redirect to user dashboard}
How do I allow both user and administrator to login through the same page but redirect to different pages using slim php and mysql database e.g
if(sid = 0) {
//redirect to admin dashboard}
else if (sid = 1) {
//redirect to user dashboard}
You can use the header
function to execute the re-direct and assuming for instance you have a database column called admin that will be 1 for yes, or 0 for no you could do the following.
if($row['admin'] == 1) // if admin, load this url - otherwise load second url
{
header('Location: http://www.google.com/');
}
else
{
header('Location: http://www.stackoverflow.com/');
}