Forums

How to use [GH] cURL with condition ?

fpayet 10 Jan, 2014
Hi,

I have a form with some fields:

email
first name
last name
A checkbox: I want to subscribe to the newsletter

I use a [GH] cURL to subscribe the peoples who fill the form to a newsletter but all of them are subscribe. I would like to subscribe only those who have checked the checkbox.
Is it possible to do that ?

Regards
Fabrice
fpayet 10 Jan, 2014
I think the Event Switcher [GH] action should solve my problem.
Could you confirm ?

I tried with this code:

<?php
if ($form->data['optin']==1)
{
return event_a;
}
?>


But I got this error message:
Fatal error: Call to undefined method JRegistry::loadString() in /home/.../public_html/administrator/components/com_chronoforms/form_actions/curl_gh/curl_gh.php on line 78

Someone can help me ?
Thanks
Fabrice
GreyHead 11 Jan, 2014
Hi Fabrice,

I replied to the cURL [GH] question in another thread, I posted a link to an upgraded version.

Your PHP here needs quotes in this line:
return 'event_a';

Bob
This topic is locked and no more replies can be posted.