这个判断没意义...
if($_POST['send']) 这里的$_POST['send']="登录",这个条件是成立的.所以会执行 header("location:dengluhou.php");-----------
改成<?php
if(is($_POST['yourname'])!="" && is($_POST['password'])!="" ){ header("location:dengluhou.php");}
?>
if($_POST['send']) 这里的$_POST['send']="登录",这个条件是成立的.所以会执行 header("location:dengluhou.php");-----------
改成<?php
if(is($_POST['yourname'])!="" && is($_POST['password'])!="" ){ header("location:dengluhou.php");}
?>
改成<?php
if(trim($_POST['yourname'])!="" && trim($_POST['password'])!="" ){ header("location:dengluhou.php");}
?>
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>
<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判断写的对吗?怎么不显示?
改成<?php
if($_POST){ header("location:dengluhou.php");}
?>