mbabaali 0 Newbie Poster

am doing my class project but am stuck i want to oepn the administrator category in valid_user table is Administrator and if Normal user to open welcomepage here is the code it only open admnwelcom.html even when the catagory is Normal_user.here is the Php code

<?php
// This code will use the username entered to open the wellcome page for kawempe health centre or admin page for administarator
require_once('Connections/Database.php');
mysql_select_db($database_Database, $Database);
//This makes sure they did not leave any fields blank
if (!$_POST['username'] | !$_POST['password'] )
{
die('You did not complete all of the required fields');
}
$a=$_POST['username'];
$b=$_POST['password'];
//This code runs if the form has been submitted

if (isset($_POST['SUBMIT']))
{

$_POST['username'] = addslashes($_POST['username']);
$sql = "SELECT * FROM valid_user WHERE user_name = '$a' AND Password = '$b'";
$result = mysql_query($sql);
$num=mysql_num_rows($result);
if($num < 1) //username and password not found
 {
exit("username and password you  entered are not valid.<br>") ;
   
}


if($result[category]<>'Normal user')
{
header("location:admnwelcom.html");
}




else {
    header("Location:wellcomepage.html");
}

}
?>

pliz help me am stuck thanks