welll im not going to spam you but i can give u some hints.
<?
$conn = mysql_connect("host", "user", "pass");
mysql_select_db("dbname");
$query= "select * from users where username = '$posted_user'";
$result = mysql_query($query);
$row=mysql_fetch_object($result);
if($posted_pass == $row->password){
header("Location: securepage.php");
}
else{
echo "you dam hackers always trying to find out passwords gezzz";
}
?>
well it looks like i did tell you the whole thing.