tags:

views:

132

answers:

2

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 and 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?

Thanks :)

A: 

Variable names are case sensitive. Use $_POST instead of $_post.

Lotus Notes
Thanks for the response Byronh! It actually was capitalized in my actual code... I've edited my post to reflect that. So it appears that's not the issue.
kimion09
A: 

Hey there,

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": http://stackoverflow.com/questions/2536100/php-paypal-ipn-getting-drop-down-menu

Mark