<?php session_start(); ?>
<html>
<title>Login Credential checking</title>
<body style="background-color:#FFFFCC" >
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<center><img src="https://i.gifer.com/ZKZg.gif"> <br>
Please wait... we redirect you soon</center>

</body>
</html><?php
include("connection.php");
echo $u=mysqli_real_escape_string($con,$_POST["username"]);
echo $p=mysqli_real_escape_string($con,$_POST["password"]);
 $q=mysqli_query($con,"select * from user where `username`='".$u."' and `password`='".$p."'  ");
      $nr=mysqli_fetch_array($q,MYSQLI_ASSOC);
	   if(mysqli_num_rows($q) > 0) {
	  $_SESSION['user_type']=$nr["user_type"];
	  $_SESSION['user_id']=$nr["id"];
	    $_SESSION['user_name']=$nr["username"];
		//$_SESSION['user_type']=$nr["user_type"];
	//	$s=mysqli_query($con,"select * from ac_session where `status`='active' ");
//	$sr=mysqli_fetch_array($s,MYSQLI_ASSOC);
//	$_SESSION['session_name']="2024";
		
		if($u=="admin") {
	  ?><script>window.location.href="inn.php";</script><?php  //
		} else {
		?><script>window.location.href="inn.php";</script><?php 
		}
	  } else { ?><script>alert("User Not Found.");
	  window.location.href="https://debendrainfo.in/building/admin/";
	  </script> <?php }

?>