<?php
require_once "DBConfig.php";
$Username=$_POST['username'];
$Password= $_POST['password'];


$result = mysqli_query($link,"SELECT * FROM user_table WHERE username ='".$Username."' AND password='".$Password."'");

if(mysqli_num_rows($result)>0) {
			while($row = mysqli_fetch_array($result)) 
			{
				$unique_key=$row["unique_key"];
				 header("location:Session_A.php?u=$unique_key");
					}
							
		}
	else
	{
   		echo '<script type="text/javascript">
       window.onload = function () { alert("Please give valid username or password");
	   window.location.href="index.php";} </script>'; 
	}
?>