我正在尝试在贝宝购物表单的选项值中插入帖子标题,以便我知道他们选择了什么项目。但当我这样做时,贝宝会给我一条错误消息,说明我的网站有问题。我做错了吗?我试图在下面的选项值中插入一篇文章的标题。
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="7MNYTPNDKMZS6">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="item_name" value="Tshirt">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="tax_rate" value="0.000">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:cart.png:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="Tshirt">Tshirt</td></tr><tr><td><select name="os0">
<option value="<?php the_title();?>">Deer $20.00 CAD</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="sex">sex</td></tr><tr><td><select name="os1">
<option value="female">female </option>
<option value="male">male </option>
</select> </td></tr>
<tr><td><input type="hidden" name="on2" value="T-shirt Style">T-shirt Style</td></tr><tr><td><select name="os2">
<option value="Crew">Crew </option>
<option value="V-neck">V-neck </option>
<option value="Deep-V">Deep-V </option>
<option value="Tank">Tank </option>
</select> </td></tr>
<tr><td><input type="hidden" name="on3" value="T-shirt size">T-shirt size</td></tr><tr><td><select name="os3">
<option value="XS">XS </option>
<option value="S">S </option>
<option value="M">M </option>
<option value="L">L </option>
<option value="XL">XL </option>
</select> </td></tr>
<tr><td><input type="hidden" name="on4" value="Effect">Effect</td></tr><tr><td><select name="os4">
<option value="faded">faded </option>
<option value="rainbow">rainbow </option>
<option value="gradient">gradient </option>
<option value="glow">glow </option>
</select> </td></tr>
<tr><td><input type="hidden" name="on5" value="T-shirt colour">T-shirt colour</td></tr><tr><td><input type="text" name="os5" maxlength="200"></td></tr>
<tr><td><input type="hidden" name="on6" value="Design Colour">Design Colour</td></tr><tr><td><input type="text" name="os6" maxlength="200"></td></tr>
</table>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="option_select0" value="Deer">
<input type="hidden" name="option_amount0" value="20.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="http://goodmorningmoon.ca/wp-content/themes/Good-Morning-Moon/images/cart.png" 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>
最合适的回答,由SO网友:helgatheviking 整理而成
为什么不将标题作为另一个隐藏输入传递?当您只有1个选项时,似乎没有太多理由选择元素。
<input type="hidden" name="on0" value="<?php the_title();?>">