Note that there are some explanatory texts on larger screens.

plurals
  1. POPayPal IPN Won't Update Database
    primarykey
    data
    text
    <p>So for some reason, this script does not update my MySQL Database with what i'm telling it to in the "<strong>if (strcmp ($res, "VERIFIED") == 0) {</strong>" block. Yet, file_put_contents('log.txt', 'verif'); that is in that block, work just fine.</p> <pre><code>&lt;?php error_reporting(E_ALL); ini_set('display_errors',1); if($_POST) { $req = 'cmd=_notify-validate'; foreach ($_POST as $key =&gt; $value) { $value = urlencode(stripslashes($value)); $req .= "&amp;$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { file_put_contents('log.txt', 'httperrrrr'); die(); } else { file_put_contents('log.txt', 'die here'); fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (stripos($res, "VERIFIED") !== false) if ($_POST['payment_status'] = "Completed") { $con = mysqli_connect("****","****","****","****"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $username = $_POST['custom']; $date = date('Y-m-d'); mysqli_query($con, "UPDATE users SET access='user', invoice_paid='$date' WHERE username='$username'"); mysqli_close($con); file_put_contents('log.txt', 'verified'); } } else if (stripos($res, "INVALID") !== false) file_put_contents('log.txt', $_POST['payment_status']); } } } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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