diff --git a/wp/ForbesHealth.php b/wp/ForbesHealth.php new file mode 100644 index 00000000..3766d3e5 --- /dev/null +++ b/wp/ForbesHealth.php @@ -0,0 +1,101 @@ + ($_POST['first-name']), + 'last_name' => ($_POST['last-name']), + 'number1' => $newphone, + 'F9domain' => $F9domain, + 'F9list' => $F9list, + 'salesforce_id' => $Campaign_ID, + 'Device_6' => $title, + 'WebDialer_Key' => $F9Date, + 'F9key' => WebDialer_Key, + 'F9CallASAP' => true + ); + + foreach ($cleanPOST as $key=>$value){ + $cleanPOST[stripslashes($key)] = stripslashes($value); + } + + $ch = curl_init(); + + // DEBUG - this should return a message to the user it failed + if (curl_error($ch) != "") { + echo "Error: $error\n"; + } + + curl_setopt($ch, CURLOPT_URL, "https://api.five9.com/web2campaign/AddToList"); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($cleanPOST)); + curl_exec($ch); + curl_close($ch); +} + +function postSalesforce() + +{ + $oid = "00D1I000000mJ0Q"; + $member_status = "Web response"; + $lead_source = "Web"; + $FORM_ID = ($_POST['form_ID']); + + if($FORM_ID == 'ForbesHealth') { + $Campaign_ID = "701Ho000001GIKJ"; + } else { + $Campaign_ID = ""; + } + + + $cleanPOST = array( + 'first_name' => ($_POST['first-name']), + 'last_name' => ($_POST['last-name']), + 'phone' => ($_POST['phone']), + 'email' => ($_POST['your-email']), + //'street' => ($_POST['street']), + //'city' => ($_POST['city']), + //'state' => ($_POST['state']), + 'zip' => ($_POST['zip']), + 'Campaign_ID' => $Campaign_ID, + 'oid' => $oid, + 'lead_source' => $lead_source, + 'Custom_Field_1__c' => ($_POST['subid1']), + 'Custom_Field_2__c' => ($_POST['subid2']), + 'Custom_Field_3__c' => ($_POST['subid3']), + 'Custom_Field_4__c' => ($_POST['subid4']) + ); + + foreach ($cleanPOST as $key=>$value){ + $cleanPOST[stripslashes($key)] = stripslashes($value); + } + + $ch = curl_init(); + + if (curl_error($ch) != "") { + exit( "Error: $error\n"); + } + + curl_setopt($ch, CURLOPT_URL, "https://webto.salesforce.com/servlet/servlet.WebToLead"); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($cleanPOST)); + curl_exec($ch); + curl_close($ch); +} + +postSalesforce(); +//postFiveNine(); \ No newline at end of file