Hi,
I am using the code below to check if the email and pass are in the
database.
Currently if they are not it just prints a blank page. If the are it prints
a login button. What I need it to do is instead of showing nothing when the
email and pass does not exsist is to show something like, Login incorrect.
The rest of the code works perfectly. I just need to fit in this to make it
complete. Can anyone explain how to do this. I just can not get it right.
Thanks.
<?
include ('config.php');
if ($email=="")
echo "Need email address. ";
else
if ($pass=="")
echo "Need password. ";
else
mysql_connect ($DBHost,$DBUser,$DBPass);
$query = "SELECT * FROM users where email='$email' and pass='$pass' ";
$result = mysql_db_query($DBName, $query);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$email = $r["email"];
$pass = $r["pass"];
$uid = $r["uid"];
$ip = $r["ip"];
$id = $r["id"];
echo "<br>";
echo "<br>";
echo "<form name=\"form1\" method=\"post\" action=\"xxxxx.php\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"Manage my Account\">";
echo "<input type=\"hidden\" name=\"uid\" value=\"$uid\">";
echo "<input type=\"hidden\" name=\"id\" value=\"$id\">";
echo "<input type=\"hidden\" name=\"page\" value=\"manage.php\">";
echo "<input type=\"hidden\" name=\"email\" value=\"$email\">";
echo "</form>";
}
} else {
echo "No data.";
}
?>