gpt4 book ai didi

PHP 在同一页面上发布

转载 作者:太空宇宙 更新时间:2023-11-04 13:34:45 25 4
gpt4 key购买 nike

我有这个代码,我想在 password = hello 时发送消息。但是页面立即显示文本:'good pass' 和 'bad pass'

这段代码有什么问题?

<body>
<?php
if(isset($_POST['submit']))
{
$wachtwoord = ($_POST['wachtwoord']);

if ($wachtwoord = "hello")
{
?><h1>Good pass</h1><?php;
}

else

if($wachtwoord != "hello")
{
?><h1>Wrong pass.</h1><?php;
}
}

else
{
?>
<center>
<br><br><br><br>
<table>
<tr><td>Hello User, <br><br><hr>
<b><a href="link0/">DirectAdmin</a><br><br>
<a href="link1/">PHPMyAdmin</a></b><br>
<form action="" method="POST">
<input name="wachtwoord" type="text" /><input type="submit" name="submit" value="Go" /></td></tr>
</form>
</table>
<br><br>
</center>
<?php
}
?>
</body>

最佳答案

您现在是 assigning if ($wachtwoord = "hello") 带有一个等号 =

像这样使用两个:== 然后按顺序执行 if ($wachtwoord == "hello") to compare .


关于PHP 在同一页面上发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25524164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com