Note that there are some explanatory texts on larger screens.

plurals
  1. POAre Simultaneous cURL HTTP requests the answer?
    text
    copied!<p>first let me start with the obligatory "Im somewhat of a noob, stupid question etc". I have something I would like to accomplish and need a little help researching the right solution. I have several web forms that are transmitted cross domain through a cURL processor (the real form processor has to reside on a separate domain due to CRM issues) so I can use jQuery's AJAX function to display the appropriate message based on the response. </p> <p>That's easy enough. We have now switched our ESP and would like to only send the email address and name to it to store in our marketing database. So included in one form is a lot of information but we only need to send those two items to our ESP.</p> <p>Should this be done with the cURL script that sends the info to our cross domain form processor or to the processor itself? If I am unclear in any of this let me know and I will expand. I know it's not ideal to "siphon" in formation to two destinations, but that decision was made above my head. Below is an example of one of my current cURL scripts.</p> <pre><code>&lt;?php $url = 'myremoteserver.com'; $referred_by_text = $_POST["referred_by_text"]; $broker_text = $_POST["broker_text"]; $email1 = $_POST["email1"]; $radiobutton = $_POST["radiobutton"]; $trade_futures = $_POST["trade_futures"]; $trade_fx = $_POST["trade_fx"]; $trade_equities = $_POST["trade_equities"]; $fields = array( 'referred_by_text'=&gt;urlencode($referred_by_text), 'broker_text'=&gt;urlencode($broker_text), 'email1'=&gt;urlencode($email1), 'radiobutton'=&gt;urlencode($radiobutton), 'trade_futures'=&gt;urlencode($trade_futures), 'trade_fx'=&gt;urlencode($trade_fx), 'trade_equities'=&gt;urlencode($trade_equities) ); foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;'; } $fields_string = rtrim($fields_string,'&amp; '); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); echo $output; curl_close($ch); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload