$v) {
$postdata.= $i . "=" . urlencode($v) . "&";
}
$postdata.="cmd=_notify-validate";
//execute curl on the command line
exec("$paypal[curl_location] -d \"$postdata\" $url", $info);
$info=implode(",",$info);
return $info;
}
//posts transaction data using libCurl
function libCurlPost($url,$data) {
//build post string
foreach($data as $i=>$v) {
$postdata.= $i . "=" . urlencode($v) . "&";
}
$postdata.="cmd=_notify-validate";
$ch=curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);
//Start ob to prevent curl_exec from displaying stuff.
ob_start();
curl_exec($ch);
//Get contents of output buffer
$info=ob_get_contents();
curl_close($ch);
//End ob and erase contents.
ob_end_clean();
return $info;
}
//posts transaction data using fsockopen.
function fsockPost($url,$data) {
//Parse url
$web=parse_url($url);
//build post string
foreach($data as $i=>$v) {
$postdata.= $i . "=" . urlencode($v) . "&";
}
$postdata.="cmd=_notify-validate";
//Set the port number
if($web[scheme] == "https") { $web[port]="443"; $ssl="ssl://"; } else { $web[port]="80"; }
//Create paypal connection
$fp=@fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30);
//Error checking
if(!$fp) { echo "$errnum: $errstr"; }
//Post Data
else {
fputs($fp, "POST $web[path] HTTP/1.1\r\n");
fputs($fp, "Host: $web[host]\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ".strlen($postdata)."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $postdata . "\r\n\r\n");
//loop through the response from the server
while(!feof($fp)) { $info[]=@fgets($fp, 1024); }
//close fp - we are done with it
fclose($fp);
//break up results into a string
$info=implode(",",$info);
}
return $info;
}
//Display Paypal Hidden Variables
function showVariables() {
global $paypal;
?>
">
">
">
">