Lid |
|
Goedendag
Telkens als ik op verzenden druk, dan krijg ik incorrect password, maar heb toch de juiste gebruikersnaam en wachtwoord ingegeven!
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username&&$password)
{
$connect = mysql_connect("localhost", "", "") or die("Couldn't connect!");
mysql_select_db("elitecorps") or die("Couldn't find database!");
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
// check to see if they match!
if ($username==$dbusername&&$password==$dbpassword)
{
echo "You are in!";
}
else
echo "Incorrect password!";
}
else
die("That user doesn't exist!");
}
else
die("Please enter a username and password!");
?>
<?php $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); if ($numrows!=0) { { $dbusername = $row['username']; $dbpassword = $row['password']; } // check to see if they match! if ($username==$dbusername&&$password==$dbpassword) { } else echo "Incorrect password!"; } else die("That user doesn't exist!"); } else die("Please enter a username and password!"); ?>
|