PHP 文件:
<?
print_r($_REQUEST);
$thispage = 'login';
require('db.php');
if($_POST['admin_username'] && $_POST['admin_password']) {
$query="SELECT * FROM login where name='".mysql_real_escape_string($_POST['admin_username'])."' AND pass = '".mysql_real_escape_string($_POST['admin_password'])."' AND level='admin'";
echo $query;
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
if($row['name'] && $row['pass']) {
$_SESSION['isAdmin'] = 1;
$_SESSION['loggedin'] = 1;
setcookie('isAdmin' , 1, time()+3600, '/', $settings['cookiedomain']);
setcookie('loggedin' , 1, time()+3600, '/', $settings['cookiedomain']);
header("Location: index.php");
exit();}
else {
header("Location: login.php?msg=Invalid%20Login");
exit();
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Area</title>
<link href="style.css" rel='stylesheet' />
<link rel="stylesheet" href="bubble-tooltip.css" media="screen">
<style>
.style1 {color: #171717}
</style>
</head>
<body>
<div id='content' style='width: 500px; border: 1px solid #171717; margin-top: 100px; background-color: #404040;'>
<h1 align="center"><img src="header.jpg" width="333" height="91" /></h1>
<p align="center">Welcome to the Admin Area</p>
<? if($_GET['msg']) { ?>
<center>
<p style='color: #FF9900; font-weight: bold;'><? echo $_GET['msg']; ?></p>
</center>
<? } ?>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" action="">
<table width="311" border="0" align="center">
<tr>
<td width="68"><strong>Username</strong></td>
<td width="231"><input type="text" name="admin_username" style='background-color: #ffffff; border: 1px solid #1F1F1F; font-size: 11px; color: #1F1F1F; width: 200px;' /></td>
</tr>
<tr>
<td><strong>Password</strong></td>
<td><input type="password" name="admin_password" style='background-color: #ffffff; border: 1px solid #1F1F1F; font-size: 11px; color: #1F1F1F; width: 200px;' /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="button" value="Login" />
</div></td>
</tr>
</table>
</form>
<p align="center"> </p>
</div>
<div id='footer'></div>
</body>
</html>
在顶部print_r($_REQUEST);
,我得到的只是 Array()。当我使用print_r($_POST);
.
Firebug 毫无疑问地显示了 POST 变量正在被提交,并且键名完全匹配。
这是从 Firebug 复制粘贴的数据,在 POST 部分下:
Partsmultipart/form-data
admin_username jeff
admin_password 51622384
button Login
phpinfo();
post_max_size 根据命令设置为 8M 。
我可能错过了什么?这是在我们以前的服务器上工作的。迁移后,由于此问题,没有人可以登录。