I'm test my site with paypal to see if i am receiving money and my system is being updated
When I ask to send email with all the information in POST I get empty email. Can someone tell me what is wrong with my code
$req = 'cmd=_notify-validate';
$req .= payment_safe_check ($_POST);
$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";
$mode = strtolower($paymod_data['PAYMENT_MODE']);
mail("to email", "subject",serialize($_POST) );
if ($mode == 'test')
{
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
}
else
{
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
}
if (!$fp)
{
// HTTP ERROR
die ("Error");
}
else
{
// NO HTTP ERROR
fputs ( $fp, $header . $req );
while (!feof($fp))
{
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0)
{
processing ( $_POST );
}
else if (strcmp ($res, "INVALID") == 0)
{
}
}
fclose ($fp);
}
Put var_dump($res) in the while code since that is context in which the variable exists.