php密码,比较,返回true或false [英] php password, compare, return true or false
本文介绍了php密码,比较,返回true或false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的服务器上有一个名为"pform.php"的文件,看起来像这样:
I have a file on my server called "pform.php", this is what it looks like:
<form action="password.php" method="get">
<input type="text" name="password13"/>
<input type="submit" value="Submit!"/>
</form>
我将其传输到另一个名为"password.php"的文件,如下所示:
I have it transfer to another file called "password.php", this is what it looks like:
<?php
$text=$_GET["password13"];
$right="You entered the right password!";
$wrong="You entered the wrong password!";
if($password13)=="test"
{
echo $right;
}
else
{
echo $wrong;
}
?>
我可以在第7行上进行哪些更改,使其比较密码"test"并返回true或false?
What can I change on line 7 that makes it compare the password "test" and return true or false?
谢谢!
推荐答案
if($password13)=="test"
应为
if($text=="test")
这篇关于php密码,比较,返回true或false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文