<?include "conninfo.php";
//print_r($_POST);

$username=$_POST["un"];//get data from the form
$password=$_POST["pw"];

$query="SELECT * FROM webusers WHERE username like '$username' AND password='$password'";//check against database for entries for this username and password
$result=mysqli_query($link,$query);
$norows=mysqli_num_rows($result);//how many rows were found?

if($norows==1)
{
session_start();//access session area of memory
$_SESSION["user"]=$username;//put username into a SESSION variable
?>
Thank you for logging in.
<br><br>
Please feel free to access my secret page<br><br>
<a href="secret.php">Secret page</a>
	
<?}
else//username and/or password were wrong
{
echo "Sorry, wrong login details";
}

?>








