有没有办法修改下面的PAYPAL生成的按钮代码,使用php varible使其动态化?这是原始代码:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZBA2RX3Q8L9V8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
这是我追求的逻辑:
<?PHP $paypal_email=client@website.com; ?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="<?PHP echo $paypal_email ?>">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
这是更加动态友好的工作:
<form name="_xclick" action="https://www.paypal.com/ck/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?PHP ech VARIABLE HERE; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="amount" value="1.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
答案 0 :(得分:0)
这是更加动态友好的工作:
<form name="_xclick" action="https://www.paypal.com/ck/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?PHP ech VARIABLE HERE; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="amount" value="1.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>