<?php 
include "config.php";
	if(isset($_POST['submit']))
	{
		$name=$_POST['Email'];
		$password=$_POST['Password'];
	
	
		// $conn=mysqli_connect("localhost","root","","petshop");
		// $conn=mysqli_connect("localhost","id18195887_petexchange","b!}Kdz@0KB^WiGpM","id18195887_petshop");
	
		$sql="SELECT * FROM adminemail WHERE 1";
	
	
		$result=mysqli_query($conn,$sql);
		  
		 foreach($result as $user) {
			  
			if(($user['Email'] == $name) && 
				($user['Password'] == $password)) {
					header("Location:adminpanel.php");
			}
			else {
			   echo'<script>alert("wrong information")
                location.assign("admin.php");
			   </script>';
			
			}
		}
	}
	  
	?>


