PHP PayPal IPN - Getting drop down menu

Posted by kimion09 on Stack Overflow See other posts from Stack Overflow or by kimion09
Published on 2010-03-29T06:23:19Z Indexed on 2010/03/29 6:33 UTC
Read the original article Hit count: 542

Filed under:
|
|
|

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 :)

© Stack Overflow or respective owner

Related posts about php

Related posts about paypal