Jump to content

Recommended Posts

This is more of a Paypal question, but I'm using php on the listener and hopefully someone has run into this problem.  I'm having trouble finding the correct POST name to use to get the OPTION SELECT for the item on my listener page.

I tried:

$option = $_POST['os0'];

But, I'm not getting anything using that. I've also tried os0_x, on0, and on0_x.

This is what I'm posting to Paypal:

<input type="hidden" name="on0" value="Term">
<select name="os0">
<option value="1 Year">1 Year</option>
<option value="3 Years">3 Years</option>
<option value="5 Years">5 Years</option>
</select>

 

Edited by jakebur01
51 minutes ago, gw1500se said:

Use var_dump() to see what $_POST contains:


echo "<pre>";
var_dump($_POST);
echo "</pre>";

You can find the variable you want from that.

Since I am not the one accessing the page, but Paypal, I've been trying to troubleshoot via mail().  I tried putting var_dump into my message but didn't work.

  $message = "<pre>";
$message .= var_dump($_POST);
$message .= "</pre>";
  $message = wordwrap($message, 70);

  // send email
  mail($to, $subject, $message, $headers);

Ok... I used:

// compose message
  $message = "<pre>";
$message .= print_r($_POST);
$message .= "</pre>";
  $message = wordwrap($message, 70);

  // send email
  mail($to, $subject, $message, $headers);

But, all it returned was the number 1.  "1".

Edited by jakebur01
1 hour ago, gw1500se said:

Use var_dump() to see what $_POST contains:


echo "<pre>";
var_dump($_POST);
echo "</pre>";

You can find the variable you want from that.

I also tried:

  // compose message
  printArray($_POST);

function printArray($array){
     foreach ($array as $key => $value){
        $message .= "$key => $value<br />";
        if(is_array($value)){ //If $value is an array, print it as well!
            printArray($value);
        }
    }
}
  $message = wordwrap($message, 70);

  // send email
  mail($to, $subject, $message, $headers);

But, it was blank.

I know it is posting the custom field for sure as I have sent different values and received them back via post.

Edited by jakebur01
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.