function form_cgi($args = array()) { $jf_form = new jf_form(); ob_start(); foreach ($_POST as $key => $value) { //echo $key." = ". $value . "<br>"; } if ($_POST['action'] == "submit") { $insertLead = $jf_form->insertJFLead($_POST); //echo "LeadID=".$insertLead."<br>"; $emailLead = $jf_form->emailJFLead($_POST); $postfields = "firstName=" . $_POST['firstName'] . "&lastName=" . $_POST['lastName'] . "&email=" . $_POST['email'] . "&phone=" . $_POST['phone'] . "&ddlprogram=" . $_POST['ddlprogram']; // Initialize your cURL session $ch = curl_init(); // Follow any Location headers curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // tell cURL what file to open curl_setopt($ch, CURLOPT_URL, 'https://secure.velocify.com/Import.aspx?Provider=Nuovometo&Client=HealthstaffTrainingInstitute&CampaignId=1042'); // tell cURL to populate the $ch variable with resutls curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Alert cURL to the fact that we're doing a POST, and pass the associative array for POSTing curl_setopt($ch, CURLOPT_POST, 1); // Post your values to the opened script curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); // Execute your cURL script $output = curl_exec($ch); // Free system resources taken by cURL curl_close($ch); } ?> <script language="JavaScript"> jQuery( document ).ready(function() { // Handler for .ready() called. window.location.assign("thank-you/"); }); </script> <?php //If relocation does not work.. apply a blank template to the form_cgi page. header("Location: /thank-you", true, 301); ob_end_flush(); exit; }