<form method="post" action="http://localhost/secret.php" >
<table border="1">
<tr>
<th>Username</th>
<td><input type="text" /></td>
</tr>
<tr>
<th>Password</th>
<td><input type="text" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Log In" /></td>
</tr>
</table>
</form>
初学php,为什么上面无法把name和password传到secret.php里,导致每次都输出Please input an effective username and password?
//secret.php
<?php
//Create short names for variables
if($_POST['name']==''&&$_POST['password']=='')
{
//Visitor need to enter a name and password
echo '<h1>Please input an effective username and password</h1>';
}
elseif($_POST['name']=='root'&&$_POST['password']=='123')
{
echo '<h1>Welcome to the New World!</h1>';
}
else
{
echo '<h1>You are not welcome!</h1>';
}
?>
<table border="1">
<tr>
<th>Username</th>
<td><input type="text" /></td>
</tr>
<tr>
<th>Password</th>
<td><input type="text" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Log In" /></td>
</tr>
</table>
</form>
初学php,为什么上面无法把name和password传到secret.php里,导致每次都输出Please input an effective username and password?
//secret.php
<?php
//Create short names for variables
if($_POST['name']==''&&$_POST['password']=='')
{
//Visitor need to enter a name and password
echo '<h1>Please input an effective username and password</h1>';
}
elseif($_POST['name']=='root'&&$_POST['password']=='123')
{
echo '<h1>Welcome to the New World!</h1>';
}
else
{
echo '<h1>You are not welcome!</h1>';
}
?>
解决方案 »
- 总是出现mysql_fetch_array(): supplied argument is not a valid MySQL result resource
- php + pgsql 处理访问海量数据问题
- php写个页面,在mysql数据库取出地址,用正则替换图片地址
- 求php里面自动发email给用户邮箱的相关代码 (100分送上 在线等)
- PHP的GD库问题
- 请教一个安装的问题
- windows下安装apache的配置手册,哪位有?
- 特急,如何使用MYSQL建立含中文的数据表,在线等......
- 请教如何实现这样的链接。
- 为什么用chdir("..")不好用?
- 为什么突然取不到数据库(mysql)里的数据?
- 怎样用smarty的模板显示mysql数据库里的表格显示出来?
<th>Username</th>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<th>Password</th>
<td><input type="text" name="password" /></td>