Email Verification & CURL

muggslab 15 Sep, 2010
I have enabled both email verification & CURL for my form. CURL is used to submit data to a third party website for an account registration. I will like to run CURL only after the email has been verified. However, currently, I notice that the CURL runs right after the email verification has been sent, and not after it has been verified.

How should I resolve this issue? Any help much appreciated..😑
GreyHead 15 Sep, 2010
Hi muggslab,

The CuRL plugin has no way of knowing that you've set up Email verification. Nor of telling when the verification has been received. You need to set up the cURL code in the Email Verification "OnSubmit After Verification - Success" box so that it gets executed after the verification takes place - which could be hours or weeks later.

Bob
muggslab 15 Sep, 2010
Hi Bob,

Thank you for the advice. I realized that I will need to establish a connection to Joomla's database in order to retrieve the form's data.

Is the following code right? Array $fields will be used to POST data to the url.


$uid = $_GET['uid'];

$db = & JFactory::getDBO();
$SQL = "SELECT * FROM ".$db->nameQuote('jos_chronoforms_get_update_2'). " WHERE " .$db->nameQuote('uid'). " = " .$db->quote($uid) .";";
$db->setQuery($SQL);
$row = $db->loadAssoc();

$lname = $row['lname'];
$fname = $row['fname'];
$username = $row['email'];

$fields = array(
	'fname'=>urlencode($fname),
	'lname'=>urlencode($lname),
	'username'=>urlencode($username),
);

/* ##### url-ify the data for the POST ##### */
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

/* ##### open connection ##### */
$ch = curl_init();

/* ##### set the url, number of POST vars, POST data ##### */
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

/* ##### execute post ##### */
$result = curl_exec($ch);

/* ##### close_ connect ##### */
curl_close($ch);



UPDATE: Attached the code after successful verification and it worked. However, it is conflicting with the email sent from Chronoform (I created it such that after verification, an email will be sent to customercare mailbox).

This is what I got in the email:

First Name:
Last Name:
Job Title:
Company Name:
Email Address:
Telephone:

All the fields are empty for some reason..
I have checked the database and none of the fields were modified by my curl code. What is actually causing the problem ?
This topic is locked and no more replies can be posted.