我正在尝试从“mcname”($custom)中获取文本框内容并将其发布到“item_name”中,但是它没有发布任何内容?我环顾四周,但我仍然找不到我的解决方案?
在任何 HTML 之前的脚本顶部:
<?php
$custom = $_post['mcname'];
?>
脚本中间的文本框、表单帖子和按钮。
<input type="text" name="mcname" id="mcname" placeholder="Enter your username here…" />
<br/>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="formval">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="__@gmail.com">
<input type="hidden" name="item_name" value="<?php echo $custom; ?>">
<input type="hidden" name="amount" value="$10.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="http://__.com/upgrade" />
<input type="hidden" name="cancel_return" value="http://__.com/upgrade" />
<input type="hidden" name="notify_url" value="http://__.com/ipn/ipn.php">
<input type="hidden" name="custom" value="Iron">
<button type="submit" class="btn btn-primary" href="#" rel="tooltip" data-placement="bottom" title="Click here to continue to PayPal." ><i class="icon-shopping- cart"></i>Checkout</a>
</form>