Hi,
I have added a cURL event to one of my Table events and it works brilliantly, however I would also like to add the same event into Global Events / Register page / After Successful registration but it just dosent do the same thing.
Its probably something to to with carrying the variables but I just cant figure it out, I have tried to swap the $values to $data but nothing, any ideas ?
Below is the code from the Table Event (which works) :-
$post_data['CustomFields[19]'] = $values["Password"];
$post_data['CustomFields[18]'] = $values["Username"];
$post_data['email'] = $values["Email"];
$post_data['CustomFields[22]'] = $values["CoachName"];
$post_data['CustomFields[20]'] = $values["TeamName"];
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
$curl_connection = curl_init('http://www.xxxxxxxx.co.uk/sendstudioxx/form.php?form=20';);
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);