I think the values were not getting passed from webloginpe.class.php to my snippet. So i figured i would add my code into this page instead. It is now picking up the values but still not updating the email database. This code does work in other pages, when called in a snippet.
Is it possible to run curl commands in this page?
Is there a better way of doing this?
Here’s the code that i have added:
PHP is not my strenght so, hope someone can help..
// EVENT: OnBeforeWebSaveUser
/**
* Add New Web Users to Mail Build If Newsletter is ticked.
* Line 736
*/
if (isset($_POST[’eshot’])) {
if ($_POST[’eshot’]=="on") {
// Send contact data to mail manager
//Get data from contact_us form
$detailsURL="
http://www.mydomain.com/a/c/";
if (isset($fullname)) {
$contactFields=’mb-name=’.$fullname;
}
if (isset($email)) {
$contactFields.=’&mb-niyud-niyud=’.$email;
}
if (isset($registerContactTelephone)) {
$contactFields.=’&mb.f-iljrk=’.$telephone;
}
if (isset($registerContactCompany)) {
$contactFields.=’&mb.f-iljru=’.$company;
}
if (isset($registerContactCountry)) {
$contactFields.=’&mb.f-iljyl=’.$country;
}
$referer="";
// Send data to mail manager
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $detailsURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $contactFields);
$ret = curl_exec($ch);
curl_close($ch);
}
}