php验证问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 05:51:57
文件名为:secret.php

<?php
@$name=$_POST['name'];
@$password=$_Post['password'];

if(empty($name)|| empty($password))

{

?>

<h1>Please Log In</h1>

This Page is secret.
<form method="post" action="secret.php">
<table border="1">
<tr>
<th>Username</th>
<td><input type="text" name="name"></td>
</tr>

<tr>
<th>Password</th>
<td><input type="passoword" name="password"></td>
</tr>

<tr><td colspan="2" align="center">
<input type="submit" value="Log In"></td>
</tr>

</table>
</form>

<?php

}

else if($name=='user'&&$pa

@$password=$_Post['password'];
改为
@$password=$_POST['password'];
试试。

$_POST要大写,接受密码的那个不对

改成这样,我测试过,成功

<? 

extract($_POST);

if(!isset($submit)) 

echo('

<h1>Please Log In</h1> 

This Page is secret. 

<form method="post" action="secret.php"> 

<table border="1"> 

<tr> 

<th>Username</th> 

<td><input type="text" name="name"></td> 

</tr> 

<tr> 

<th>Password</th> 

<td><input type="passoword" name="password"></td> 

</tr> 

<tr><td colspan="2" align="center"> 

<input