Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在其他PHP代码中以字符串形式显示PHP代码_Php_Paypal - Fatal编程技术网

如何在其他PHP代码中以字符串形式显示PHP代码

如何在其他PHP代码中以字符串形式显示PHP代码,php,paypal,Php,Paypal,我需要在管理面板粘贴此代码,然后在网站上显示贝宝按钮 <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="6UKjJ8hU6ML5f"> <input

我需要在管理面板粘贴此代码,然后在网站上显示贝宝按钮

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="6UKjJ8hU6ML5f">
<input type="hidden" name="custom" value="<?php print($_SESSION['mid'].'-'.$_SESSION['mps']);?>">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

现在的问题是,由于Paypal表单中的PHP代码,每当我试图在网站上打印上述值(Paypal按钮)时,它都会给出错误,因为另一个PHP代码中有PHP代码

我也认为,打印htmlentities($rs->fields(“ppbutton”)

print htmlentities($rs->fields("ppbutton"));
是你最好的选择

您可以从此网站获取有关该功能的最新更新


它将整个paypal按钮代码显示为字符串,而不是像按钮那样让买家可以点击。它将整个paypal按钮代码显示为字符串,而不是像按钮那样让买家可以点击。因此,您希望该代码显示在按钮内,然后包装在按钮内,按钮标签。我想在页面上打印paypal代码后,在页面上正确显示paypal按钮代码,并将2个php变量作为隐藏元素。请询问您是否需要更多信息。我一直在努力。
print htmlentities($rs->fields("ppbutton"));