Password checking
| From: | Wee Chua | Date: | Tue, 05 Sep 2000 13:35:41 +0000 |
| Subject: | Password checking | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15289@lists.php.net to get a copy of this message | ||
Hi all,
Could anyone tell me why I have an error on password checking (the one on
Bold)? Thanks in advance.
<html>
<?php
$db = mysql_connect("localhost", "$username", "$password");
mysql_select_db("mysql", $db) or die ("Unable to connect to database");
$result = mysql_query("Select user,password From user Where user=
'$username'",$db);
$row = mysql_fetch_array($result);
if (($row["user"] == $username) and (($row["password"]) == $password) and
($username !="")) {
echo "Haha!";
else
{
echo "Why!";
}
?>
</body>
</html>
Calvin