Doge
Active Member
- Jan 12, 2012
- 174
- 40
Can't get this to work
Any idea? Help will be credited. Can't for the life of me see it.
Code:
<?php
if(isset($_POST['submit'])){
$input['username'] = htmlentities($_POST['username'], ENT_QUOTES);
$input['password'] = htmlentities($_POST['password'], ENT_QUOTES);
if ($stmt = $conn->prepare("SELECT FROM users WHERE username=? AND password=?"))
{
$stmt->bind_param("ss", $input['username'], $input['password']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0)
{
$_SESSION['username'] = $input['username'];
$_SESSION['logged'] = 1;
header("Location: login.php");
}
} else {
echo "<br /><form class=\"form-signin\"><div style=\"text-align: center;\">Error: failed to log you in!</div></form>";
}
}
$conn->close();
?>
Any idea? Help will be credited. Can't for the life of me see it.