The username row comes out perfectly but the password row refuses to come through.
I am at a loss here.
Does anybody know what the solution is?
here is my code::
<?php
//Mass include file
include ("includes/mass.php");
//This is the login script
//Grabbing the login values and storing them
$username = $_POST['username'];
$password = $_POST['password'];
$submit = $_POST['submit'];
if (isset($submit))
{
if (strlen($username)<2) // put || ($username==(same as value on the database)
{
echo ("<br>You must enter a longer username</br>");
}
elseif (strlen($password)<=6)
{
echo ("<br>You must enter a longer password<br>");
}
else
{
$sql = "SELECT * FROM user WHERE username = '$username'";
$query = mysql_query($sql);
$numrows = mysql_num_rows($query);
if ($numrows != 0)
{
while ($row = mysql_fetch_assoc($query))
$dbusername = $row['username'];
$dbpassword = $row['password'];
if ($dbusername == $username && $dbpassword == $password)
{
echo "your in!";
}
else
{
echo "Wrong info";
}
}
else
{
die ("That username doesnt exist");
}
}
}
?>