how do i differentiate redirection page for user and admin?
Database Table:
Here is my code;
<?php
require ("config.php");
//connect to mysql
$link = mysqli_connect($h,$u,$p,$db)
OR die(mysql_error());
$query = "select * from login where username='".$_POST["uname"]."'and password='".$_POST["pswd"]."'";
$result = mysqli_query($link,$query);
$count =mysqli_num_rows($result);
//while($row = mysqli_fetch_assoc($result)) {
//}
if($count==1){
session_start();
$_SESSION['username'] = $_POST["uname"];
$_SESSION['password'] = $_POST["pswd"];
header("Location: index.html");
}
else{
echo "<script language=\"JavaScript\">\n";
echo "alert('Username or Password was incorrect!');\n";
echo "window.location='login.html'";
echo "</script>";
}
?>
How do i seperate user and admin login, i rather new here so your explanation/code is much appreciate!
Thanks in advance!
