Macemore
Circumcised pineapples
No matter what, the login will be false even when it shouldn't.
Any help?
PHP:
<?php
define('awesome', '1');
include('../inc.php');
mysql_connect($host, $usr, $pwd);
mysql_select_db($db);
if(isset($_POST['user'], $_POST['pass'])) {
$user = mysql_real_escape_string(htmlentities(stripslashes($_POST['user'])));
$pass = sha1($_POST['pass']);
$log = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = `{$user}` AND `password` = `{$pass}`") or die(mysql_error());
$tell = mysql_result($log, 0);
}
if($tell == 0) {
echo "Incorrect login, <a href='index.php'>go back</a>";
} else {
$_SESSION['loggedin'] = '1';
echo "Successfully logged in, <a href='admin.php'>go to admin</a>";
}
?>
Any help?