Forums

Trying to use the cURL function to send a command and not accepting my parameters

junk4jake 26 Aug, 2014
I have a form that is collecting a phone number and message to send using an SMS API on the web and it allows http URL to send. I can get this to work when I go directly to the address with my browser and even IN THE FORM when I hard code the api username, password, from number, to number, and the message with the cURL function, but not if I try to use the fields from my form. They will not populate by data.

Direct http URL in browser example that WORKS:
http://rest.nexmo.com/sms/xml?api_key=*********&api_secret=********&from=17137669056&to=15075551212&text=test!!!
Header:
  [curl] =>       
            15075551212
            ***********************
            0
            17.65440000
            0.00480000
            310260
 

Footer:

curl
CURL OK : the CURL function was found on this server.
$curl_values:
curl_target_url: http://rest.nexmo.com/sms/xml?api_key=*********&api_secret=*********&from=17137669056&to=15075551212&text=test!!!

[attachment=0]cURL.png[/attachment]
The example above works and it will come in to my phone, but it isn't using the params from my form.

The setup that I think I want is this:
TARGET URL:
http://rest.nexmo.com/sms/xml?api_key=*********&api_secret=*********&from=17137669056&to={param_phone}&text={param_message}

Params/Fields map:
param_phone={freesmsnumber1}
param_message={freesmsmessage1}
[attachment=1]debug.png[/attachment]
GreyHead 26 Aug, 2014
Hi junk4jake,

Please remove the { }
param_phone=freesmsnumber1
param_message=freesmsmessage1

Bob

[[>> Later - sorry the forum does odd things if I post { } with no space between them <<]]
junk4jake 26 Aug, 2014
now says :

Data Array: 
Array
(
    [option] => com_chronoforms
    [view] => form
    [Itemid] => 217
    [chronoform] => mobile_topup
    [event] => submit
    [mobilenumber] => 6511561651
    [topup] => option1
    [freesmsnumber1] => 16123567377
    [freesmsmessage1] => message to jake
    [topupbuttom] => Top Up
    [419eb0cd8b98d072cbb6da396fbb5c0b] => 1
    [curl] => 

    
        
            3
            to address '{param_phone}' is not numeric
        
    


)


and

Debug Data
curl
CURL OK : the CURL function was found on this server.
$curl_values: param_phone=1612*******¶m_message=message to jake
curl_target_url: http://rest.nexmo.com/sms/xml?api_key=********&api_secret=*/******&from=17137669056&to={param_phone}&text={param_message}


so instead of the form values, still using {param_phone} and {param_message}
junk4jake 26 Aug, 2014
does same if removed bracket from target too

Debug Data
curl
CURL OK : the CURL function was found on this server.
$curl_values: param_phone=7987987797797878xxx7¶m_message=message to jake
curl_target_url: http://rest.nexmo.com/sms/xml?api_key=xxxxxxx32&api_secret=xxxxxxxx2&from=99900909090ppn56&to=param_phone&text=param_message
junk4jake 02 Sep, 2014
Is there another way if the PARAMS aren't properly pulling from the form, perhaps I can pull from the database after I do a DB save?
junk4jake 02 Sep, 2014
Always....should I find a way to hand write the CURL?
Debug Data
curl
CURL OK : the CURL function was found on this server.
$curl_values: phone=15077220736&message=will this get into the URL?
curl_target_url: http://rest.nexmo.com/sms/xml?api_key=**********&api_secret=**************&from=17137669056&to=phone&text=message
junk4jake 02 Sep, 2014
I also am getting a message back saying

            3
            to address 'phone' is not numeric
Max_admin 05 Sep, 2014
There are many posts here now, what's the current problem ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
junk4jake 08 Sep, 2014
The main problem is that I am trying to use the cURL function, but when I enter the parameters, it seems to be recognizing the data in the debugger, but I can't get it to insert the form data into the URL. It always says the name value of the parameter instead of placing the form data there.
Max_admin 09 Sep, 2014
The parameters should be set in this format:
param_name_to_be_sent=form_field_name_in_data_array


please post your current debug info and the cURL parameters list you have!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 11 Sep, 2014
Please post screenshots for the curl action config then.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 11 Sep, 2014
Hi junk4jake,

Please check the curl settings - it looks to me as if you have para_number somewhere instead of param_number

Bob
junk4jake 15 Sep, 2014
Yes Bob, I see that now, have changed it, how this is all my data with it still not working:






junk4jake 15 Sep, 2014
If you look at https://ezworldpay.com/images/3.png, you can see that the code properly taking the FORM values and inserting them into the $curl_values, BUT when it comes time to create the url, it is not placing the values there, still keeping the variable names....
Max_admin 16 Sep, 2014
The best way to test this is to clear the "param/fields" box and hardcode the other values in the curl target url, then test it, does it work ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 16 Sep, 2014
Hi junk4jake,

Why do you have to=param_number and text=param_message in the Target URL?

You appear to be setting those values in the Params/Files map box with different names?

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