I ahve a form which the user enters username and password and pesses submit.
my php page then looks to see if there is a user with that username and password. it doesn't matter what password i use it lets me in each time.
Any ideas why this is.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$linkID = @mysql_connect("localhost", "root", "");
mysql_select_db("Customer", $linkID);
$resultID = mysql_query("SELECT * FROM tblLogon where UserName like '$username' AND Password like '$password'", $linkID);
if ($resultID == True)
{
print "$username, $password";
}
else
{
print "Your login failed sorry.<p>";
}
mysql_close($linkID);
?>
</body>
</html>
any help appreciated
am i complete wrong here login prob
Moderator: General Moderators
-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
Try this...
Code: Select all
<?php
$linkID = @mysql_connect("localhost", "root", "");
mysql_select_db("Customer", $linkID);
$resultID = mysql_query("SELECT * FROM `tblLogon` where `UserName`='$username' AND `Password`='$password'", $linkID);
if(mysql_num_rows($resultID) > 0)
{
print "$username, $password";
}
else
{
print "Your login failed sorry.<p>";
}
mysql_close($linkID);
?>-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester