So, I connected a my website to MySQL and I made a login form. This is where the values from the textbox are submitted:
<?php
$username = $POST["username"];
$password = $POST["password"];
mysql_connect("localhost","opticon2_rgstr","mario106");
mysql_select_db("opticon2_rgstr");
$result = mysql_query("select * from users where username='$username' and
password='$password'");
$row = mysql_fetch_array($result);
if ($row['username'] == $username && $row['password'] == $password)
{
echo "Successfully logged in!";
}
else
{
echo "Username or password are incorrect!";
}
?>
I added a user called "admin" with the password "admin" in the database, but even if I type in a wrong username and a wrong password it says: "Successfully logged in!"