I'm having some problems getting cURL to work...
what I need to do is POST some variables to worldpay, and redirect the browser to the page I've posted these variables to.
I seem to be able to POST the variables but my page doesn't seem to go anywhere
// CURL
$submitstring = "";
foreach($_POST as $index=>$value) {
$notsubmitted=array('_stage', 'association', 'giftaid');
$in = true;
foreach($notsubmitted as $not) {
if($index==$not) {
$in = false;
}
}
if($in) {
$submitstring .= $index.'='.$value.'&';
}
}
$ch = curl_init("https://select.worldpay.com/wcc/purchase");
//curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $submitstring);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://www.meditateinscotland.org/donate.php");
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
$data = curl_exec($ch);
curl_close($ch);