Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting Paypal Return string into mysql database?
    text
    copied!<pre><code>public function run() { $postFields = 'cmd=_notify-validate'; foreach($_POST as $key =&gt; $value) { $postFields .= "&amp;$key=".urlencode($value); } $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL =&gt; $this-&gt;_url, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_SSL_VERIFYPEER =&gt; false, CURLOPT_POST =&gt; true, CURLOPT_POSTFIELDS =&gt; $postFields )); $result = curl_exec($ch); curl_close($ch); $fh = fopen('result.txt', 'w'); fwrite($fh, $result . ' -- ' . $postFields); fclose($fh); echo $result; } } ?&gt; </code></pre> <p>I get the result in a text file like so:</p> <p>?cmd=_notify-validate&amp;test_ipn=1&amp;payment_type=instant&amp;payment_date=02:39:41 Oct 06, 2011 PDT&amp;payment_status=Completed&amp;address_status=confirmed&amp;payer_status=verified&amp;first_name=John&amp;last_name=Smith&amp;payer_email=buyer@paypalsandbox.com&amp;payer_id=TESTBUYERID01&amp;address_name=John Smith&amp;address_country=United States&amp;address_country_code=US&amp;address_zip=95131&amp;address_state=CA&amp;address_city=San Jose&amp;address_street=123, any street&amp;business=seller@paypalsandbox.com&amp;receiver_email=seller@paypalsandbox.com&amp;receiver_id=TESTSELLERID1&amp;residence_country=US&amp;item_name=something&amp;item_number=AK-1234&amp;quantity=1&amp;shipping=3.04&amp;tax=2.02&amp;mc_currency=USD&amp;mc_fee=0.44&amp;mc_gross=12.34&amp;mc_gross_1=9.34&amp;txn_type=web_accept&amp;txn_id=41106939¬ify_version=2.1&amp;custom=xyz123&amp;charset=windows-1252&amp;verify_sign=AB3bSjvFd3wXL7rCt.OOGW-nSKg-Ahh5RbboVG4bn9LSAon94Wjt2Oj9</p> <p>How do I decode this string and put it into mysql database?</p> <p>I need the customer first name, last name, address,email, item number, item name, quantity, shipping, and timestamp put into the database. Please I have come this far in the code, I just need help decoding it and getting it into the database. Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload