<?php include('include/dbconnect.php');

if (isset($_POST['submit'])) {
$UserName=$_POST['username'];
$Password=$_POST['ipassword'];

$sql = "SELECT * FROM users where username='$UserName' and ipassword='$Password'";

$result = $conn->query($sql);

$count = mysqli_num_rows($result);

if ($count == 1){
    	session_start();

    		
    		$_SESSION['username'] = $UserName;
    		
		header('location:donor_data.php');
        } else {
   	header('location:login.php'); 
    
}

}

?>