gpt4 book ai didi

执行两个条件的 PHP IF 语句

转载 作者:太空狗 更新时间:2023-10-29 16:49:00 24 4
gpt4 key购买 nike

我目前正在将支付系统集成到我的网站中。我有一个响应脚本,它基本上从安全服务器获取数据,并在付款是否通过时显示给客户。我的问题是 if 语句实际上向客户显示了两条消息,即使付款成功或不成功。

这是 If 语句:

<?
if ($result == "00") && ($payersetup == "00") && ($pmtsetup =="00"){
?>
Thank you
<br/><br/>
To return to the home page <a href="http://www.xx.com"><b><u>click here</u></b></a>
<br/><br/>

<?
} else {
?>

<br/><br/>
There was an error processing your subscription.
To try again please <a href="http://www.xx.com/signUp.html"><b><u>click here</u></b></a><br><BR>
Please contact our customer care department at <a href="mailto:support@xx.com"><b><u>support@xx.com</u></b></a>

<?
}
?>

我也尝试通过以下方式执行此操作,但是使用这种方法时,正文是空白的 - 没有显示任何文本。

<?
if ($result == "00") && ($payersetup == "00") && ($pmtsetup =="00"){
$thanks = "Thank you! \n\n To Return to the homepage <a href=http://www.epubdirect.com>Click Here</a>";
echo $thanks;
}
else
{
$nothanks = "There was an error processing your subscription.\n\n To try again please <a href=http://www.epubdirect.com/signUp.html>click here</a>. \n\n If the problem persists, please contact our customer care department at <a href=mailto:support@epubdirect.com>support@epubdirect.com</a>";
echo $nothanks;
}
?>

然后我尝试将 HTML 放入单独的文档中并使用 require_once() 但这也不起作用 - 与之前的结果相同 - 空白正文。

有人有什么想法吗?

编辑:

我已经尝试了一些建议的方法,但是我仍然遇到空白页问题:(

这是我走过的路->

<?
if (($result == "00") && ($payersetup == "00") && ($pmtsetup =="00"))
{
require_once('thankyou.html');
}
else
{
require_once('error.html');
}
?>

即使语法看起来正确,这仍然给我一个空白页?

最佳答案

尝试:

if (($result == "00") && ($payersetup == "00") && ($pmtsetup =="00") ) {
...
...
}

关于执行两个条件的 PHP IF 语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3769468/

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