I didn't have any code here on line 31 in this code so what do you think what's the problem here? :)
<?php
require('config.php');
if(isset($_POST['submit'])) {
$uname = mysqli_real_escape_string($con, $_POST['uname']);
$pass = mysqli_real_escape_string($con, $_POST['pass']);
$sql = mysqli_query($con, "SELECT * FROM users WHERE uname = '$uname' AND pass = '$pass'");
if (mysqli_num_rows($sql) > 0) {
echo "You are now logged in.";
exit();
}
} else {
$form = <<<EOT
<form action="login.php" method="POST">
Username: <input type="text" name="uname" /></br>
Password: <input type="password" name="pass" /></br>
<input type="submit" name="submit" value="Log in" />
</form>
EOT;
echo $form;
}
?>
I think that all my brackets are fine :D