473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Curl and Sending query string to SMPP server

Hi,

I am trying to send some querysting using cURL. This is the working
API

http://smpp4.routesms.com:8080/bulks...ge=testmessage.

The infomation given by Routesms.com:

Port: 2345
Server: SMPPHTTP

This is my code:

$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}

Following results are expected.

1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit

Bu nothing is coming other than Failed.

Pls help me. Thank you in advance.

Lakmarket
Nov 15 '08 #1
6 9947
lakmarket wrote:
Hi,

I am trying to send some querysting using cURL. This is the working
API

http://smpp4.routesms.com:8080/bulks...ge=testmessage.

The infomation given by Routesms.com:

Port: 2345
Server: SMPPHTTP

This is my code:

$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}

Following results are expected.

1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit

Bu nothing is coming other than Failed.

Pls help me. Thank you in advance.

Lakmarket
What does curl_error() show?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 15 '08 #2
On Nov 15, 1:17*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lakmarket wrote:
Hi,
I am trying to *send some querysting *using cURL. This is the working
API
http://smpp4.routesms.com:8080/bulks...=xxxxxxx&passw.....
The infomation given by Routesms.com:
Port: 2345
Server: SMPPHTTP
This is my code:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
Following results are expected.
*1701 = Success
*1702 = Invalid URL Error
*1703 = Invalid value in username or password field
*1704 = Invalid value in "type" field
*1705 = Invalid Message
*1706 = Invalid Destination
*1707 = Invalid Source (Sender)
*1708 = Invalid value for "DLR" field
*1709 = User validation failed
*1710 = Internal Error
*1025 = Insufficient Credit
Bu nothing is coming other than Failed.
Pls help me. * Thank you in advance.
*Lakmarket

What does curl_error() show?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?
Thank you
Nov 15 '08 #3
On Nov 15, 6:37 am, lakmarket <lakmar...@gmail.comwrote:
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lakmarket wrote:
Hi,
I am trying to send some querysting using cURL. This is the working
API
>http://smpp4.routesms.com:8080/bulks...=xxxxxxx&passw....
The infomation given by Routesms.com:
Port: 2345
Server: SMPPHTTP
This is my code:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
Following results are expected.
1701 = Success
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in "type" field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for "DLR" field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit
Bu nothing is coming other than Failed.
Pls help me. Thank you in advance.
Lakmarket
What does curl_error() show?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?

Thank you
No, when you incurr curl_error() you will get what curl is saying is
wrong.
Nov 15 '08 #4
On Nov 15, 5:24*pm, Michael Gooden <m...@michael-gooden.infowrote:
On Nov 15, 6:37 am, lakmarket <lakmar...@gmail.comwrote:
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lakmarket wrote:
Hi,
I am trying to *send some querysting *using cURL. This is the working
API
http://smpp4.routesms.com:8080/bulks...=xxxxxxx&passw....
The infomation given by Routesms.com:
Port: 2345
Server: SMPPHTTP
This is my code:
$ch = curl_init();
$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxx&password=xxxxxxx&type=0&dlr=0&dest ination=94xxxxxxxxx&source=testing&message=testmes sage";
curl_setopt($ch,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
if(!$result){
echo "Failed<br>";
}
Following results are expected.
*1701 = Success
*1702 = Invalid URL Error
*1703 = Invalid value in username or password field
*1704 = Invalid value in "type" field
*1705 = Invalid Message
*1706 = Invalid Destination
*1707 = Invalid Source (Sender)
*1708 = Invalid value for "DLR" field
*1709 = User validation failed
*1710 = Internal Error
*1025 = Insufficient Credit
Bu nothing is coming other than Failed.
Pls help me. * Thank you in advance.
*Lakmarket
What does curl_error() show?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
The only message display on the screen is "Failed". Do I have to
insert curl_error() somewhere in the code?
Thank you

No, when you incurr curl_error() you will get what curl is saying is
wrong.
Thanks for the information

curl_error() message is: No URL set!

If somebody willing to help I can email the test account username and
password.

Regards,

Lakmarket
Nov 15 '08 #5
Hi,

I did some corrections of the program.

$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!curl_exec($ch))
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}

Now the output is Curl error: couldn't connect to host

Thanks
Nov 15 '08 #6
lankansoft wrote:
Hi,

I did some corrections of the program.

$url = "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!curl_exec($ch))
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}

Now the output is Curl error: couldn't connect to host

Thanks
That's because "http://smpp4.routesms.com:8080/bulksms/bulksms?
username=xxxxxxx&password=xxxxx&type=0&dlr=0&desti nation=xxxxxx&source=xxxxxx&message=testscriptold" ;

is not a URL. It is a URL and a query parameter list.

Only the URL is passed in CURLOPT_URL. The parameter list is passed in
CURLOPT_POSTFIELDS.

I'd recommend you google for a CURL tutorial. It will help you a lot.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 15 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Simmons | last post by:
I am stumped. I encoded the action = of my form using GET and I can't seem to get the property/value stuff from it using a JavaScript script I got from the web. I want to create a trivia game...
8
by: dstefani | last post by:
Hello, I was wondering if you can get the info from the query string in a server-side javascript tag? Here's what I'm trying to do In the head of page A ....
1
by: anshul | last post by:
Can somebody tell me about state management in asp.net using Query Strings. I am just unable to understand this. Anshul
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
18
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling...
1
by: c1pkw | last post by:
Hi there, I've used the cUrl library to return a query string from a remote server to a variable. The query string looks a bit like this: ...php?message_id=a1&recipient=unit1&sendday=fri...
25
nirmalsingh
by: nirmalsingh | last post by:
hai all, i am using, ajax and c#.net. my problem is, i want to store a huge data in database using(c#), which is done in behind the screen. when i get data from a html textarea(more than...
7
by: mak1084 | last post by:
Hi, I want to make online registration script. To do this I searched google and found that cURL can be used, to send a query to the remote sever and getting the data back. Can you guys help me...
4
Claus Mygind
by: Claus Mygind | last post by:
In my code I am sending a number of records via an ajax post method to the web-server for updating a table. I will parse the query string when it is received on the server side. But I am not sure...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.