I've written a very simple page login script which asks for a username and password. obviously, i want it to check both, and if match, let the user proceed, if not, then produce error msg.
sounds simple... but my script lets you through if you only get the username OR password, instead of both!
my main bit of script is this:
if ($jcml == "159561") {
$username = trim($username);
$password = trim($password);
if (($username == "admin") && ($password == "carrott")) {
//I think the line above is causing the problems
print ('
<br><br><table border="0" cellspacing="0" cellpadding="0" width="360">
<tr><td align="left">
<font color="red">Username and Password combination not recognised.</font><br><br>
Click <a href="login.php">here</a> to go try again<br><br>
Click <a href="../index.php">here</a> to return to the Guestbook
</td></tr>
</table>
');
} else {
//lets you into the admin page
header("Location:../admin.php");
exit;
}
} else {
//write the rest of the form and login page
}
any ideas what i'm doing wrong? it must be something obvious!