<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>';
}
?>
解决方案 »
- 我写了一个js 用于把别的div高变成下边div的top值 可是在谷歌浏览器有毛病 求帮助
- 小弟菜鸟一只 求解一个关于zend studio的应用问题
- 如果根据本周的星期几计算出日期是多少
- ThinkPHP模板中的if语句
- php中文输出为乱码问号
- PHP将文章中的图片匹配出来
- PHP多关键字加空格搜索高亮显示的问题
- 本人菜鸟,按照书本和网上的介绍在xp下搭建php+apache+mysql,可是显示mysql没有连接成功,请各位指教
- php浏览一个文本文件,导入到文本区域,应该怎么写呢?
- PHP+Apache的配置问题:Apache能显示html,但显示不了PHP
- 为什么突然取不到数据库(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>