cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

cURL result into variable

From: Adrian Mcmanus <adrianm_at_airmail.net>
Date: Tue, 23 Apr 2002 13:02:23 -0700

Hello,

I am new to cURL and I am attempting to post to a secure server using CURL.
I am able to post my variables to the server just fine and return the result
onto the page but I can not seem to return the result into a variable so
that I am parse the result string.

Here is my code:

function achPost($MEN,$MPA,$MID,$CRO,$CAC,$CPH,$PAM)
{
    $URL="onlinechecks.interceptcorporation.com/icolc/short.cgi";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,"https://$URL");
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS,
"MEN=$MEN&MPA=$MPA&MID=$MID&CRO=$CRO&CAC=$CAC&CPH=$CPH&PAM=$PAM");
        $result = curl_exec($ch);
        curl_close ($ch);
        return $result;
}

The result is returning a value of 1. Any help would be greatly
appreciated.

Regards,

Adrian Mcmanus
adrianm_at_airmail.net
Received on 2002-04-23