I have this login form in a switch statement:
if($message==2)
{ echo "Log-In:
<p>
If you need to register, please visit the <a href=\"main.php?inc=join\">registration page</a>.<p>
<center><form method=post action=\"validate.php\">
<table width=\"\" border=\"0\"><tr><td><input name=\"username\" type=\"text\" value=\"username\" class=\"user2\"></td>
<td rowspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"LOGIN\" class=\"login2\"></td></tr>
<tr><td><input name=\"password\" type=\"password\" value=\"password\" class=\"user2\"></td></tr></table>
</form></center>
"; }
Validate.php
if ($submit) {
$dbh=mysql_connect () or die ('I cannot connect to the database.');
mysql_select_db ("db");
$result=mysql_query("select * from users where name='$username' && password='$password'") or die ("cant do it");
while ($row=mysql_fetch_array($result)) {
if ($row["password"]==$password && $row["name"]==$username) {
// Register some session variables!
session_register('username');
$_SESSION['username'] = $username;
session_register('password');
$_SESSION['password'] = $pword;
header("Location: $row[url]");
exit();
}
}
The problem I am having is that when I try to include the same exact form into my included menu page, it doesn't work. When I access the menu page itself, it works properly, but if I include it, it stops working. Also, the form that is part of the variable above stops working when I remove the <form> part of the form on my menu included page. I have a headache from trying to figure out why. The form code works properly on it's own and I have tried removing properties from the pages its included in, but it still doesn't work properly.
Any suggestions or answers?
Thanks.