<?include "conninfo.php";

$username=$_POST["username"];
$password=$_POST["password"];

$query="SELECT * FROM people WHERE username like ? AND password like ?";


$stmt=mysqli_stmt_init($link);
mysqli_stmt_prepare($stmt,$query);
mysqli_stmt_bind_param($stmt,"ss",$username,$password);
mysqli_stmt_execute($stmt);


$result=mysqli_stmt_get_result($stmt);


$numrows=mysqli_num_rows($result);

if ($numrows>0){?>
<br><br><b>Thank you for logging in. Here are your details:<br><br>
<?

    while ($r=mysqli_fetch_array($result))
    {
    echo $r["id"]." ";
    echo $r["firstname"]." ";
    echo $r["surname"]." ";
    echo $r["address"]."<br>";
    }
}
else
{
echo "Sorry, no records found";
}

?>
