<?php

require ('../credentials.php');
$con=mysqli_connect(HOST, USERNAME, PASSWORD, DBNAME)or die("cannot connect"); 

// array for JSON response


if(isset($_POST['username']))
{
    $username=$_POST['username'];
	 $password=$_POST['password'];
	  
    $sql ="select username,password from admin where username ='".$username."' and password= '".$password."'";   

	
	//echo $sql;
  $result = mysqli_query($con, $sql) or die("Error in Selecting " . mysqli_error($con));
  
   $emparray = array();
    while($row =mysqli_fetch_assoc($result))
    {
             $emparray[] = $row;
    }
   // echo json_encode($emparray);

   if (mysqli_num_rows($result) > 0) {
    echo "1";
	
} else {
    echo "0";
}

     
}
mysqli_close($con);
?>
