这个判断没意义...
if($_POST['send']) 这里的$_POST['send']="登录",这个条件是成立的.所以会执行 header("location:dengluhou.php");-----------
改成<?php
 if(is($_POST['yourname'])!="" && is($_POST['password'])!="" ){     header("location:dengluhou.php");}
?>

解决方案 »

  1.   

    -----------
    改成<?php
     if(trim($_POST['yourname'])!="" && trim($_POST['password'])!="" ){     header("location:dengluhou.php");}
    ?>
      

  2.   

    <script language="javascript">
    function check(){
    if(document.all.form1.yourname.value==""||document.all.form1.password.value==""){
    alert("你输入的不完整");
    return false;
    }
    return true;
    }
    </script>
    <HTML>
    <head><title>登录界面</title></head>
    <body>
    <form action="dengluhou.php" method="post" name="form1" onsubmit="return check();">
    用户名:<input type='text' name='yourname'><p>
    密码:<input type='password' name='password'><p><p>
    <input type='submit' name='send' value='登录'>
    <a href="http://localhost/test/zhuce.php">免费注册</a></form>
    </body>
    </html>
      

  3.   

    在php中,首先要点击send按钮然后再进行比较,怎么写啊?
      

  4.   

    <html>
    <head><title>计算</title></head>
    <body>
    <form action="<? echo $PHP_SELF ?>" method="post">
    操作数:<input type='text' name='var' value="<?php
    echo($_POST['var1']);?>" ><p>
    <input type='submit' name='sqrt' value='sqrt'>
    <input type='submit' name='exp' value='exp'>
    </form>
    <?php
    if($_POST['sqrt']) {
    $var1=sqrt($var);
    }
    ?>
    </body>
    </html>if判断写的对吗?怎么不显示?
      

  5.   

    esinzhong()和esinzhong() 把与条件改成或条件吧。用与条件不是非常好
      

  6.   

    -----------
    改成<?php
     if($_POST){     header("location:dengluhou.php");}
    ?>
      

  7.   

    if($_POST['send'])这个判断只是判断了有没有POST过来,至于过来的值是多少,是没有关系的。你可以设为if($_POST['send']&&$_POST['send']!='')