确认php.ini中register_globals 是否为 off
如是,则if($send)->if($_POST['send'])
如是,则if($send)->if($_POST['send'])
解决方案 »
- 请高手指点下正则表达式
- 在我们公司内部局域网有很多台电脑,都装有Apache,但是大家的外网IP都是一个;外网如何访问其中某一台电脑啊?
- 关于php的syslog函数输出日志问题
- 如何从$c='a=1,2&b=3,4'中得到$a='1,2',$b='3,4'呢?
- 请教一个无限分类的问题 请高手帮忙
- 急!!win2003 中iis 设置问题
- 高分求一在线咨询程序源码
- 二维数组的遍历
- 这是什么意思:Unable to jump to row 0 on MySQL result index 3
- 现在有谁在呀,来报个到吧。哈哈。
- 如何匹配utf-8字串的位置?
- 使用 DOMDocument对象修改 XML 文件时遇到的问题,请高人指点!
显然前面有输出呀,输出了窗体或表单!
所以header应该会出错!
仔细想想对不对?
同意
if($send) {
header("location:dengluhou.php");
}
?>
放到最开头的,你前面都有html输出了
if($send) {
header("location:dengluhou.php");
}
?><HTML>
<head><title>登录界面</title></head>
<body>
<form>
用户名:<input type='text' name='yourname'><p>
密码:<input type='text' name='password'><p><p>
<input type='submit' name='send' value='登录'>
</form>
</body>
</html>
if(isset($_POST['login'])) {
if(isset($_POST['username'])&&$_POST['username']=='a'&&isset($_POST['password'])&&$_POST['password']=='b') {
header("Location: index1.php");
exit();
}else
echo "请输入正确的用户名和口令";
}
?><html>
<head>
<title>登录权限认证</title>
</head>
<body>
<form method="POST" action="login.php"> <div align="center">
<center>
<table border="1" cellspacing="10" width="30%" height="200">
<tr>
<td width="100%" align="center" colspan="2" height="28">登录权限认证</td>
</tr>
<tr>
<td width="50%" align="right" height="25">用 户:</td>
<td width="50%" align="center" height="25"><input type="text" name="User" size="20"></td>
</tr>
<tr>
<td width="50%" align="right" height="25">密 码:</td>
<td width="50%" align="center" height="25"><input type="password" name="Passwd" size="20"></td>
</tr>
<tr>
<td width="100%" align="center" colspan="2" height="27">
<input type="submit" value="提交" name="Submit">
<input type="reset" value="重写" name="Reset">
</td>
</tr>
</table>
</center>
</div>
</form>
</body>
</html>
因为没找到这个传递的变量
php.ini中的register_globals=on
<HTML>
<head><title>登录界面</title></head>
<body>
<?php
if($send) {echo("aaa");
header("location:dengluhou.php");
echo("bbb");}
?>
<form>
用户名:<input type='text' name='yourname'><p>
密码:<input type='text' name='password'><p><p>
<input type='submit' name='send' value='登录'>
</form>
</body>
</html>当执行时显示了aaa和bbb,可就是不跳转到dengluhou.php。如果把php.ini中的register_globals设置为off,if($send)改成if($_POST['send']),那么aaa和bbb就都不显示了,也不跳转了,问题出在哪里啊?
if($send) {echo("aaa");
header("location:dengluhou.php");
echo("bbb");}
?>
<HTML>
<head><title>登录界面</title></head>
<body>
<form>
用户名:<input type='text' name='yourname'><p>
密码:<input type='text' name='password'><p><p>
<input type='submit' name='send' value='登录'>
</form>
</body>
</html>
其实你既然要跳转了。那输出已经没有意义了
if($_POST['send']) => if(isset($_POST['send']))
$_POST['send']大小写的问题吧