I am working on a script which will update a master server using cURL through a PHP CB Auto Action trigger. As you will see in the code sample below I am pulling a variety of CB user fields and posting them to the HTTPS urls. I have tested each cURL script individually and they work fine. THe issue is that when I put them back to back as you can see here only the first script is functioning.
Code:
$rdcno = rawurlencode('[cb_rdcno]');
$fname = rawurlencode('[firstname]');
$lname = rawurlencode('[lastname]');
$address1 = rawurlencode('[cb_addressline1]');
$city = rawurlencode('[cb_city]');
$state = rawurlencode('[cb_state]');
$zipcode = rawurlencode('[cb_zip]');
$cancel_date = date('Y-m-d');
$curl = curl_init();
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_URL, 'https://mysite.com/integration.php?type=CANCEL&rdcnumber='.$rdcno.'&cancel_date='.$cancel_date.'');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$Response = curl_exec($curl);
return $Response;
curl_close($curl);
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_VERBOSE, 1);
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl2, CURLOPT_TIMEOUT, 30);
curl_setopt($curl2, CURLOPT_URL, 'https://mysite.com/service.php?customer_id='.$rdcno.'&siteid=LMCU-TEST&name_first='.$fname.'&middle_name=-&name_last='.$lname.'&address='.$address1.'&city='.$city.'&state='.$state.'&zip='.$zipcode.'&type=CANCEL');
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, 1);
$Response2 = curl_exec($curl2);
return $Response2;
curl_close($curl2);
Any idea why this configuration is not working for both of these scripts at the same time?