Hello all,
I am having a problem with the below script and im not sure why.
The error message that I am getting is:
Notice: Undefined variable: request_method in C:\Program Files\Apache Group\Apache2\htdocs\fns\login.php on line 49
However this code is working fine on a hosted site and not on an internal machine with the same install of Apache, SQL and PHP. I have always used the $request_method option of checking if a form is being posted and never had any problems until now.
Any suggestions??
Thanks
Coogan
I am having a problem with the below script and im not sure why.
The error message that I am getting is:
Notice: Undefined variable: request_method in C:\Program Files\Apache Group\Apache2\htdocs\fns\login.php on line 49
However this code is working fine on a hosted site and not on an internal machine with the same install of Apache, SQL and PHP. I have always used the $request_method option of checking if a form is being posted and never had any problems until now.
Any suggestions??
Thanks
Coogan
Code:
<form name="form1" method="post" action="">
<p> </p>
<p> </p>
<p> </p>
<table width="277" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="118"><span class="style1">Username:</span></td>
<td width="159"><input name="username" type="text" id="username" size="20" maxlength="12"></td>
</tr>
<tr>
<td class="style1">Password:</td>
<td><input name="password" type="password" id="password" size="20" maxlength="8"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="login" type="submit" id="login" value="login">
</div></td>
</tr>
</table>
<?
# processed when form is submitted back onto itself
if ($request_method=="post") {
# setup SQL statement
$login_id = $username;
$login_pass = $password;
if ($login_id== '') {$login_id="blank";}
if ($login_pass== '') {$login_pass="blank";}
$SQL = " SELECT * FROM fns_admin";
$SQL = $SQL . " WHERE username = '$login_id' ";
# execute SQL statement
$retid = mysql_db_query($db, $SQL, $cid);
# check for errors
if (!$retid) { echo( mysql_error()); }
else { $row = mysql_fetch_array($retid);
$user_id = $row["confirm_id"];
$user_pass = $row["password"];
$user_user = $row["username"];
if ($user_user== $login_id) {if ($user_pass== $login_pass) {echo("<SCRIPT
LANGUAGE=javascript>document.location= \"/admin.php?userid=$user_id\"</script>");}
else { echo("<p
class=\"style1\" align=\"center\">Invalid Username or Password</p>"); }
}
else {echo("<p class=\"style1\" align=\"center\">Invalid Username or
Password</p>"); }
#echo("$user_id");
}
}
?>
</form>