I am currently integrating a payment system into my website. I have a script response that basically takes data from a secure server and displays it to the client if the payment passed or not. My problem is that the if statement actually displays both messages to the client, even if the payment was successful or unsuccessful.
Here is the If statement:
<? 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> <? } ?>
I also tried to do it as follows, but with this method the body is empty - the text is not displayed.
<? 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; } ?>
And after that I tried to put the HTML in a separate document and use require_once (), but that didn’t work either - the same as the previous one - an empty body.
Does anyone have any ideas?
EDIT:
I tried some of the suggested methods, but I still have a problem with a blank page :(
That's how I left →
<? if (($result == "00") && ($payersetup == "00") && ($pmtsetup =="00")) { require_once('thankyou.html'); } else { require_once('error.html'); } ?>
Does this still give me a clean page, although the syntax looks right?
source share