I'm using Paypal's buy it now buttons along with an IPN handler written in PHP to send me an e-mail whenever a purchase is made. The e-mail is properly being sent a开发者_运维知识库nd is passing much of the data, but it's not capturing the drop down list for selecting a clothing item's size.
Here's my button code fields:
<input type="hidden" name="item_name" value="Test Shirt">
<input type="hidden" name="item_number" value="001">
<input type="hidden" name="on0" value="sizes">
Select a size:
<select name="os0">
<option value="Small">Small </option>
<option value="Medium">Medium </option>
<option value="Large">Large </option>
<option value="Extra Large">Extra Large </option>
</select>
My PHP IPN script that captures the data into variables looks like this:
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$size = $_POST['on0'];
$sizeChoice = $_POST['os0'];
The e-mail properly displays the item name and item number, but nothing for the $size and $sizeChoice variables. It's late so I'm sure I'm looking over something very obvious but am still wondering if I'm just calling it wrong or if I'm forgetting some hidden fields?
Had the same probelm today. Instead of using $_POST['os0'] and $_POST['on0'], use $_POST['option_selection1'] and $_POST['option_name1']
This page shows the options, search for "option_name1": Getting drop down menu
Variable names are case sensitive. Use $_POST instead of $_post.
精彩评论