确认php.ini中register_globals 是否为 off
如是,则if($send)->if($_POST['send'])

解决方案 »

  1.   

    用header时前面也没有输出阿。???
    显然前面有输出呀,输出了窗体或表单!
    所以header应该会出错!
    仔细想想对不对?
      

  2.   

    qngzh() ( ) 
    同意
      

  3.   

    <?php
    if($send) {
    header("location:dengluhou.php");
    }
    ?>
    放到最开头的,你前面都有html输出了
      

  4.   

    <?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>
      

  5.   

    高手帮我看一下我这个页面怎么没有跳转啊?<?php
    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">用&nbsp户:</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">密&nbsp码:</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>
      

  6.   

    isset($_POST['login'])永远都是false
    因为没找到这个传递的变量
      

  7.   

    还是有问题:
    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就都不显示了,也不跳转了,问题出在哪里啊?
      

  8.   

    要记住 header() 必须在任何实际输出之前调用,不论是来自普通的 HTML 标记,空行或者 PHP。<?php
    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>
      

  9.   

    对了。。在调用header 之前输出了,所以上面的代码是错误的
    其实你既然要跳转了。那输出已经没有意义了
      

  10.   

    改成这样试过吗?
    if($_POST['send']) =>   if(isset($_POST['send']))
      

  11.   

    我在header后加上输出语句只是想测试一下header运行过没有,刚刚加上了isset了,还是不好用啊
      

  12.   

    我的$_POST['SEND']不好用,怎么回事啊?register_globlas=off了
      

  13.   

    $_POST['SEND']
    $_POST['send']大小写的问题吧