Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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
";
$header .= "Content-Type: application/x-www-form-urlencoded
";
$header .= "Content-Length: " . strlen($req) . "

";

$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);
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
142 views
Welcome To Ask or Share your Answers For Others

1 Answer

Put var_dump($res) in the while code since that is context in which the variable exists.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...