Forums

Syntax for Field Map in CURL ?

vedouze 14 Mar, 2011
Hello!!
I'm working on using CF with a checkbox to register the user to my Acy Newsletter. I've followed the Acymailing tutorial detailled here:
http://www.acyba.com/en/support/documentation/107-acymailing-chronoform.html#curl
As this tutorial has been done for the CF v3, i'm a little lost for the syntax to use for matching the fields between CF and Acymailing.
What should I put in the Params/Fields map ?

Also is there still a CURL plugin to activate as described in the same tutorial ("# Click on the tab Plugins # Click on the CURL plugin to enable it) ?

Many thanks
Ved.
GreyHead 14 Mar, 2011
Hi Ved,

I haven't looked at this yet. From a quick glance Max's help message suggests that you can only use input names.

Multi line format of the fields names:
e.g:curl_param_name=form_field_name


I'll take a look at the code and see if constants are allowed too.

Bob
vedouze 14 Mar, 2011
Thank you Bob
GreyHead 15 Mar, 2011
Hi Ved,

As I suspected the code shows that there is just a straight substitution in this version. I have some better code in a 3.2 plug-in, I'll hunt that down and see if I can create a modified action.

Bob
vedouze 15 Mar, 2011
Hello Bob, that's good news.
Thank you again
vedouze 15 Mar, 2011
Just to help: i've opened a thread in Acymailing forum (unfortunately in french 😶 ) so we made the following changes:
- target URL : http://www.yourwebsite.com/index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1
- Params/Fields map:
user[email]=email
user[name]=name

I've enabled the debug mode and I get:
1. CURL OK : the CURL function was found on this server.
2. $curl_values: user[email]=&user[name]=testname
3. curl_target_url: http://www.yourwebsite.com/index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1

As suggested by John (Acymailing), I swap the 2 values in field map, and then the debbug shows that only the second value is getting transmitted.

Hope it can help.
Ved.
GreyHead 15 Mar, 2011
Hi Ved,

Please find attached an alternative cURL action. Install it by unzipping and uploading the curl_gh folder to administrator/components/com_chronoforms/form_actions

There are some important differences from the CFv3 plug-in and the standard CFv4 action:[list]
  • The syntax for form input values is parameter={input_name}

  • You can add fixed values by omitting the curly brackets parameter=Some value

  • Array values will be handled by creating an array of curl values

  • If the value contains an '=' sign it will be handled correctly so parameter=a = b is OK

  • Empty lines will be ignored

  • Lines with no '=' will be ignored

  • Lines with parameter= and no value will be ignored

  • Use the special value parameter=NULL if you want to send an empty value

  • White space at the beginning and end of parameters and values is stripped
  • [/list]

    Please treat as beta code and let me know if you find any bugs.

    Here are the Param/Fields map box entries from my test form:
    aaa={input_text_0}
    bbb={input_checkbox_group_1}
    ccc=Some value
    ddd= Some other = value
    
    eee
    fff=
    ggg   =   Lots of spaces
    hhh=NULL

    and the debug output when the form is submitted (there's no actual cURL transaction here).

    1. CURL OK : the CURL function was found on this server.
    2. Empty string found in the Parameter box
    3. Parameter eee has no value set
    4. Parameter fff has no value set
    5. $curl_values: aaa=testing&bbb[0]=choice+1&bbb[1]=choice+2&bbb[2]=choice+3&ccc=Some+value&ddd=Some+other+%3D+value&ggg=Lots+of+spaces&hhh=
    6. curl_gh_target_url: http://example.com



    Bob

    PS I read the AcyMailing forum post - thank you.
    vedouze 15 Mar, 2011
    Hello again Bob,
    I've followed your instructions:
    1- uploaded the curl_gh folder in
    administrator/components/com_chronoforms/form_actions/
    2- with the help of Acymailing (same post: http://www.acyba.com/fr/support/forum/6-support-en-francais-french-support/17744-403-access-forbidden-sur-le-test-de-subscription-via-url.html), I've put the following field map/param:
    target_url: http://www.mysite.com/index.php?option=com_acymailing
    user[email]={email}
    user[name]={name}
    ctrl=sub
    task=optin
    hiddenlists=1

    Apparently I don't get the user registered in Acymailing. Here is the debug:
    1. CURL OK : the CURL function was found on this server.
    2. $curl_values: user[email]=&user[name]=&ctrl=&task=&hiddenlists=
    3. curl_target_url: http://www.mysite.com/index.php?option=com_acymailing

    Thanks
    Ved.
    GreyHead 15 Mar, 2011
    Hi Ved,

    That looks like the output from the standard Action. Do you see a cURL [GH] action in the Actions panel? If so plese drag that over, copy and paste the code into it then remove the standard CURL Action.

    Bob
    vedouze 16 Mar, 2011
    'Morning Bob!
    Sorry for my poor knowledge but apparently we're making progress. It looks ok on CF side, that's the debug info:
    curl_gh

    1. cURL OK : the cURL function was found on this server.
    2. $curl_values: user[email]=test%40gmail.com&user[name]=test&ctrl=sub&task=optin&hiddenlists=1
    3. curl_gh_target_url: http://www.monsite.com/index.php?option=com_acymailing

    However we still don't get the user subscribed to the newsletter. John from Acymailing is asking me if we can get the server response for the Curl action, but I don't know how to get it.
    Could you guide me?
    Thanks
    GreyHead 16 Mar, 2011
    Hi Ved,

    It's no problem - I'm still finding my way around CFv4.

    I'll take a look at what is needed to add the response to the debug code.

    Meanwhile please will you make one small change. Put http://www.monsite.com/index.php in the target url and add option=com_acymailing as an extra entry in the Params/Fields box.

    Bob
    vedouze 16 Mar, 2011
    Hello Bob,
    Just to let you know, I'm getting the following message:
    Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.
    But then I tried to go backwards (leaving ?option=com_acymailing in the target URL) and still get the same error. Maybe yesterday I went too quickly as today I've no touch anything else apart cleaning the cache??
    Thanks for your help
    GreyHead 16 Mar, 2011
    Hi Ved,

    I'm not sure where that error comes from - not anything that I'm seeing.

    I've got a subscription working OK using the cURL [GH] action with the following settings:

    Target URL :
    http://www.my_domain.com/index.php

    Params/Field map:
    user[name]={name}
    user[email]={email}
    ctrl=sub
    task=optin
    option=com_acymailing
    hiddenlists=1

    Here 'name' and 'email' are the two input names from my form.

    Bob
    Max_admin 17 Mar, 2011
    Hi ved,

    Please upgrade to V4 RC1.6 then test this and let us know, the upgrade is easy, just install the new one OVER the one you have, you will not lose any data this way, do NOT uninstall.

    Regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    GreyHead 17 Mar, 2011
    Hi Ved,

    the URL problem looks like something amiss with SEF URLs, the two sections both say the same. But they shouldn't both appear.

    Bob
    vedouze 17 Mar, 2011
    Hello Bob,
    True, I reinstalled before but forgetting to desactivate the SEF advance for CF.
    So, I've followed your instructions and update the component to RC1.6

    I still get the error:
    Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.

    The URL once submitted is:
    http://www.mysite.com/index.php?option=com_chronoforms&chronoform=concurso&event=submit
    I've noticed that if I re-enter the URL (I mean click Enter at the end of the line on the URL line), I have the following debug:
    #
    curl_gh

    1. cURL OK : the cURL function was found on this server.
    2. $curl_values: user[name]=&user[email]=&ctrl=sub&task=optin&option=com_acymailing&hiddenlists=1
    3. curl_gh_target_url: http://www.mysite.com/index.php

    Hope it helps!
    Thanks
    GreyHead 17 Mar, 2011
    Hi Ved,

    Hmm . . . looks like the plug-in is working fine and there's a problem with the site, or possibly the form inputs.

    The error message is a Joomla! one.. I think that it is triggered if there are any variables with numeric input names in the $_POST or $GET arrays.

    By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

    Bob
    GreyHead 17 Mar, 2011
    Hi ved,

    There's good news and not so good news.

    The error message was caused because you had an input with an illegal numeric name '1', I changed that the 'registrame' and the error has gone.

    [attachment=0]17-03-2011 14-08-29.png[/attachment]

    The cURL then runs OK but the response is 403 Forbidden, which I guess is something in the site security.

    [attachment=1]17-03-2011 14-23-58.png[/attachment]

    On the other hand putting the Target URL and The query string together into a url works OK and the registration is made.

    [attachment=2]17-03-2011 14-26-09.png[/attachment]

    I'm not clear what gives the 403 Forbidden error, it might be possible to get round it by changing the cURL Method to GET --I'll need to tweak the action some more to test that.

    Bob

    PS I installed exTplorer so that I could edit the files and check out the cURL response.
    vedouze 17 Mar, 2011
    Thanks for all your help Bob.
    I've contacted my host to see if they find some weird configuración. Actually I also bumped into a 403 forbidden and then open the thread in Acymailing (because of a non accepted Redirect. John suggested it could be because of special caracters ":" "/") It could have make sense if it was possible to register with only the short CURL gh target URL...
    To mention, I'm running RS-Firewall with a config I have not touched (Verify system variables for PHP injections etc...).
    I keep you posted in case my hosting provider finds something.
    GreyHead 17 Mar, 2011
    Hi ved,

    As an experiment, please try turning off RS FireWall. I suspect that is blocking the cURL call to ACYMailer.

    I'm pretty certain that the :// will not normally cause a problem.

    Bob
    vedouze 17 Mar, 2011
    Hello Bob,
    I had only "desactivated" the RS-Firewall but apparently it was not enought. Following your post, I totally desinstalled it and then... it works!!
    So thank you again
    GreyHead 17 Mar, 2011
    Hi Ved,

    Great, I'm glad we pinned down the cause.

    There must be a setting in the firewall that will let those transactions through - but I have no idea where to start looking.

    Bob
    vedouze 17 Mar, 2011
    Thanks. I will try to ask the RS-Firewall team. But for now my hosting provider guaranted me with enough protection so RS is redundant they say.
    Anyway really nice component and awesome support. I'll buy it very soon
    Thanks
    fabscarf 04 Sep, 2011
    I think that i have read every post but no solution:
    1) I have to curl chronoform to acymailing
    2) My test server is localhost.
    3)target url is http://localhost/mionab/index.php
    4) Params/field map:
    user[name]={name}
    user[email]={email}
    ctrl=sub
    task=optin
    option=com_acymailing
    hiddenlists=1

    The system does not subscribe the user to the mailing list in psng_acymailing_subscriber, which is the default table for acymailing.
    However i i add a DB in chonoform i can get the data to be written in there.
    Is there any solution to it?
    GreyHead 04 Sep, 2011
    Hi fabscarf,

    Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6.

    Neither version of the standard CURL plug-in/action handle array variables well, at least up to CFv4 RC1.9. If you are using CFv4 then my cURL [GH] action handles array correctly.

    Bob
    fabscarf 05 Sep, 2011
    Thank you for your reply
    I use joomla 1.6 and Chronoforms_J1.6_V4_RC1.9.
    Also i have download and copy the file of curl GH and i use it but still nothing gets written in the acymailing newslettr table.
    I can subscribe to the newsletter if a do so via URL. The system is working properly but i suspect that i made some mistake i cannot spot.
    Have you goy any other advice for me.
    GreyHead 05 Sep, 2011
    Hi fabscarf,

    Please post screenshots of the settings you are using.

    Bob
    fabscarf 06 Sep, 2011
    Thank you for the reply
    Here i have uploaded my form [attachment=0]My form.jpg[/attachment]
    fabscarf 06 Sep, 2011
    My curl setting are[attachment=1]My actions.jpg[/attachment][attachment=1]My actions.jpg[/attachment]
    I want the curl to post into the newletter id=1 in acymailing. As i said i can subcribe via URL in my webbwriser but not with Chronoform.
    I realize that i am only posting two fields at the moent but i have done so for testing purposes.
    I'd like that the subsciber could choose if subcribing or not.
    GreyHead 06 Sep, 2011
    Hi fabscarf,

    There's a difference between the code you posted earlier and your screenshot in these two lines:
    user[name]={name}
    user[email]={email}
    I think you need this version for the data to be sent correctly.

    The rest all looks fine except for the localhost URL. Is that working OK?

    Bob
    fabscarf 07 Sep, 2011
    Hi
    sorry the one i have posted was just a try
    my code is now
    user[name]={name}
    user[email]={email}
    ctrl=sub
    task=optin
    option=com_acymailing
    hiddenlists=1
    As i think it should be.
    Problem is that is still does not write anything into the list (newsletter) =1
    I have done a number of try and i confirm again that i can subscribe if i input the data into an url in my browser. So that i think that everything is working except the fact that i cannot get the CURL right or the subscription via URL fro Chronoform.
    Have you got any idea. Alternatively i will publish the website over the next few day an you will be able to give it a look to the backend if needed.
    I am happy to buy you a pack of six beers if needed :-)
    Max_admin 09 Sep, 2011
    Please show us an example link which works when you use it in the browser address bar.

    Regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    fabscarf 10 Sep, 2011
    Hi
    Thank you for your response
    When i insert this test url in the browser http://localhost/mionab/index.php/?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1&user[email]=fabscarf96@gmail.com
    to test if the server responds i get a nice subscription to acymailing
    When i try to prlicate the behaviour with curl in Chronoform i use this link
    http://localhost/mionab/index.php/?option=com_acymailing
    and i the params
    user[name]={name}
    user[email]={email}
    ctrl=sub
    task=optin
    option=com_acymailing
    hiddenlists=1
    Something is wrong but i do not know what.
    I will appreciate any suggestion.
    Max_admin 10 Sep, 2011
    Well, I believe that this is not a valid parameter name:
    user[name]


    Do you have a documentation for the acymailing which explains how to subscribe a user through a URL ?

    Also, what are the acymailing features you are looking for ? because you can use Chronoforms itself as a newsletter subscription form and email sender.

    Regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    fabscarf 10 Sep, 2011
    Hi
    There is a documentation on line for the curl and subscription via URL at http://www.acyba.com/en/support/documentation/107-acymailing-chronoform.html tjhe instruction refer to the previous version of Chronoform that i used before and liked but i have difficulties in translate it into the new version for joomla 1.6
    Otherwise i am quite happy to use chonoform for newsletter
    Basically i want to do be able to use a form to add some extra field and validation control (acymailing does not do so) and subscribe to acymailig list. I like chnonoform because is very flexible, so that i bought it but now i am stack.
    I just need some instruction on how to pull this work off.
    fabscarf 13 Sep, 2011
    Hi
    is there anyway to turn the chronoform debug??
    I will appreciate an answer.
    GreyHead 15 Sep, 2011
    Hi fabscarf,

    You can drag a Debugger action into the form On Submit event; that will give you some information. And you can use temporary Custom Code actions to give you more specific outputs if you need it.

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