Hi,
I have the following login form which posts to a login.php script:
<html>
<head>
<title>Login to Secret Area</title>
</head>
<body>
<form method="post" action="login.php">
<p><b>Username:</b><br>
<input type="text" name="username" size="10"></p>
<p><b>Password:</b><br>
<input type="password" name="password" size="10"></p>
<p><input type="submit" name="submit" value="Login"></p>
</form>
</body>
</html>
=====
After I type in the username and password and I click Login, I'm receiving the following message:
The page cannot be found
====
This doesn't make sense since I checked my directory and the login.php file is there. I'm not sure whether there is something within login.php that might be causing this error.
Can someone help me out?
Thanks in advance.
====
Here is login.php:
<?php
include "conn.inc.php";
// Check to see if values were entered
if ((!$POST[username]) || (!$POST[password]))
{
header("Location: test2.htm");
exit();
}
// SQL statement which matches the values entered to the values in the table
$sql = "SELECT * FROM member WHERE username = '$POST[username]' AND password = password('$POST[password]')";
// Variable to hold results of the query
$result = @($sql,$conn) or die(mysql_error());
// Counts the number of rows from the results of the query
$num = mysql_num_rows($result);
// If number of rows is greater than 0, a match is found - if zero, no match is found
if ($num != 0 )
{
header("Location: member_area.htm");
}
else
{
header("Location: test2.htm");
exit;
}
?>