
<?PHP

session_start();
# STOP HERE 
#################################################################### 
# THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE 
include"config.php";
$username=$_POST['username'];
$password=$_POST['password'];
$query="select * from user_details where username='$username' and password='$password'";
$link=mysqli_query($conn,$query) or die('Error, failed to select records'); 
if(mysqli_num_rows($link) > 0)

{
	$member = mysqli_fetch_assoc($link);
	//$_SESSION['sess_username'] = $member['username'];
			$_SESSION['SESS_FIRST_NAME'] = $member['name'];
			$_SESSION['SESS_LAST_NAME'] = $member['position'];
			//$_SESSION['SESS_PRO_PIC'] = $member['profImage'];
	
	header("location: main/index.php");
}

else 
	header("location: index.php");
?>
