
<?PHP
session_start();
# STOP HERE 
#################################################################### 
# THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE 
include"config_l.php";

$a=$_POST['username'];
$b=$_POST['password'];
$query="select * from user_details where username='$a' and password='$b'";
$link=mysqli_query($db,$query) or die('Error, failed to select records'); 
if(mysqli_num_rows($link) > 0)

{
	$member = mysqli_fetch_assoc($link);
	$_SESSION['sess_username'] = $member['username'];
	
	header("location:index.php");
}

else 
	header("location:login.php");

?>
