I think I found more of the problem. See, I also have a register script which looks like this
<?php
include('connect.php');
include "header.php";
if($loggedin == '1')
die("You can't register another account while you're logged in.");
if(isset($_POST['submit']))
{
$uname = trim($_POST['username']);
if((!isset($POST['username'])) || (!isset($POST['pass']))
|| ($uname == '') || ($_POST['pass'] == ''))
die("Please fill out the form completely. <br><br>
<a href=register.php>Continue</a>");
$check = @("SELECT id FROM users WHERE username = '$uname'");
$check = @mysql_num_rows($check);
if($check > 0)
die("Sorry, that username has already been taken. Please try again.
<br><br>
<a href=register.php>Continue</a>");
$pass = md5($_POST['pass']);
$date = date("m/d/y");
$newPlayer = @("INSERT INTO users (username, password, registered) VALUES ('$uname', '$pass', '$date')") or die("Error: ".mysql_error());
echo 'You have been registered! You may now <a href=default.php>Log in</a>.';
}
else
{
echo'
<form action=register.php method=post>
<table><tr><th colspan=2>
Register</tr></th><tr>
<td>Username:</td><td>
<input type=text name=username>
</td></tr>
<tr><td>
Password:</td><td>
<input type=password name=pass>
</td></tr><tr><th colspan=2>
<input type=submit name=submit value=Submit>
</tr></th>
</table>
</form>';
}
include "footer.php";
?>
And when I went on my site, I tried registering with the username 'apples' and the password 'banana'. And once again, trying to sign in with this failed. When i went into my database i saw that it successfully registered the username 'apples' but the password is 72b302bf297a228a75730123efef7c41, the md5 hash for banana.