jakebur01 Posted November 3, 2019 Share Posted November 3, 2019 (edited) 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 November 3, 2019 by jakebur01 Quote Link to comment https://forums.phpfreaks.com/topic/309458-trouble-posting-option-select-to-ipn-listener/ Share on other sites More sharing options...
gw1500se Posted November 3, 2019 Share Posted November 3, 2019 Use var_dump() to see what $_POST contains: echo "<pre>"; var_dump($_POST); echo "</pre>"; You can find the variable you want from that. Quote Link to comment https://forums.phpfreaks.com/topic/309458-trouble-posting-option-select-to-ipn-listener/#findComment-1571207 Share on other sites More sharing options...
jakebur01 Posted November 3, 2019 Author Share Posted November 3, 2019 (edited) 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 November 3, 2019 by jakebur01 Quote Link to comment https://forums.phpfreaks.com/topic/309458-trouble-posting-option-select-to-ipn-listener/#findComment-1571209 Share on other sites More sharing options...
jakebur01 Posted November 3, 2019 Author Share Posted November 3, 2019 (edited) 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 November 3, 2019 by jakebur01 Quote Link to comment https://forums.phpfreaks.com/topic/309458-trouble-posting-option-select-to-ipn-listener/#findComment-1571210 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.