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:
Footer:
[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]
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]
Hi junk4jake,
Please remove the { }
Bob
[[>> Later - sorry the forum does odd things if I post { } with no space between them <<]]
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 <<]]
now says :
and
so instead of the form values, still using {param_phone} and {param_message}
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}
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
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?
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
I also am getting a message back saying
3
to address 'phone' is not numeric
There are many posts here now, what's the current problem ?
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.
The parameters should be set in this format:
please post your current debug info and the cURL parameters list you have!
Regards,
Max
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
Please post screenshots for the curl action config then.
Hi junk4jake,
Please check the curl settings - it looks to me as if you have para_number somewhere instead of param_number
Bob
Please check the curl settings - it looks to me as if you have para_number somewhere instead of param_number
Bob
Yes Bob, I see that now, have changed it, how this is all my data with it still not working:






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....
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 ?
This topic is locked and no more replies can be posted.