php中点击按钮跳转到另一个页面的问题 确认php.ini中register_globals 是否为 off如是,则if($send)->if($_POST['send']) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用header时前面也没有输出阿。???显然前面有输出呀,输出了窗体或表单!所以header应该会出错!仔细想想对不对? qngzh() ( ) 同意 <?phpif($send) {header("location:dengluhou.php");}?>放到最开头的,你前面都有html输出了 <?php 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> 高手帮我看一下我这个页面怎么没有跳转啊?<?phpif(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> isset($_POST['login'])永远都是false因为没找到这个传递的变量 还是有问题: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就都不显示了,也不跳转了,问题出在哪里啊? 要记住 header() 必须在任何实际输出之前调用,不论是来自普通的 HTML 标记,空行或者 PHP。<?phpif($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> 对了。。在调用header 之前输出了,所以上面的代码是错误的其实你既然要跳转了。那输出已经没有意义了 改成这样试过吗?if($_POST['send']) => if(isset($_POST['send'])) 我在header后加上输出语句只是想测试一下header运行过没有,刚刚加上了isset了,还是不好用啊 我的$_POST['SEND']不好用,怎么回事啊?register_globlas=off了 $_POST['SEND']$_POST['send']大小写的问题吧 做什么项目比较好呢 apache伪静态规则配置问题带?为什么会404 pdo 总行数 采集 安装GD模块遇到的问题 请求高手帮助,急!!!!!!!!! 大家帮我看一小这个正则式子~ 问个很简单的分页问题! exec( "rm -rf $counterFile");什么意思? socket的timeout问题 如何匹配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']大小写的问题吧