473,788 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=xxxxx xx&type=0&dlr=0 &destination=94 xxxxxxxxx&sourc e=testing&messa ge=testmessage" ;
curl_setopt($ch ,$url);
curl_setopt($ch ,CURLOPT_RETURN TRANSFER,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 9983
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=xxxxx xx&type=0&dlr=0 &destination=94 xxxxxxxxx&sourc e=testing&messa ge=testmessage" ;
curl_setopt($ch ,$url);
curl_setopt($ch ,CURLOPT_RETURN TRANSFER,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*******@attgl obal.net
=============== ===
Nov 15 '08 #2
On Nov 15, 1:17*pm, Jerry Stuckle <jstuck...@attg lobal.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=xxxxx xx&type=0&dlr=0 &destination=94 xxxxxxxxx&sourc e=testing&messa ge=testmessage" ;
curl_setopt($ch ,$url);
curl_setopt($ch ,CURLOPT_RETURN TRANSFER,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...@attgl obal.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...@gmai l.comwrote:
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attg lobal.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=xxxxx xx&type=0&dlr=0 &destination=94 xxxxxxxxx&sourc e=testing&messa ge=testmessage" ;
curl_setopt($ch ,$url);
curl_setopt($ch ,CURLOPT_RETURN TRANSFER,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...@attgl obal.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.infowrot e:
On Nov 15, 6:37 am, lakmarket <lakmar...@gmai l.comwrote:
On Nov 15, 1:17 pm, Jerry Stuckle <jstuck...@attg lobal.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=xxxxx xx&type=0&dlr=0 &destination=94 xxxxxxxxx&sourc e=testing&messa ge=testmessage" ;
curl_setopt($ch ,$url);
curl_setopt($ch ,CURLOPT_RETURN TRANSFER,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...@attgl obal.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=xxxxxx x&password=xxxx x&type=0&dlr=0& destination=xxx xxx&source=xxxx xx&message=test scriptold";
curl_setopt($ch , CURLOPT_URL, $url);
curl_setopt($ch , CURLOPT_TIMEOUT , 20);
curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 1);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 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=xxxxxx x&password=xxxx x&type=0&dlr=0& destination=xxx xxx&source=xxxx xx&message=test scriptold";
curl_setopt($ch , CURLOPT_URL, $url);
curl_setopt($ch , CURLOPT_TIMEOUT , 20);
curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 1);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 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=xxxxxx x&password=xxxx x&type=0&dlr=0& destination=xxx xxx&source=xxxx xx&message=test scriptold";

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_POSTFIE LDS.

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*******@attgl obal.net
=============== ===
Nov 15 '08 #7

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

Similar topics

2
2219
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 where the user gets 1 question at a time and it keeps scoring until the end and gives a summary and I want to do it only in JavaScript (no ASP, PHP, JSP, etc). I tried submitting the quiz page to itself using a query string to keep track of...
8
2188
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
3343
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
7680
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 error below. Can I access a Web Service through a Query Sting. I need to send XML to a Flash movie using a Web Service. Thank You, Jim Lewis Server Error in '/WebService1' Application.
18
44667
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 webservices.
1
1479
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 At the moment, the whole of this query string is contained in a single variable ($qstring) so if I print $qstring, "message_id=a1&recipient=unit1&sendday=fri" will be sent to the browser.
25
2612
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 2000 characters), and pass to c# page through query string from javascript(ajax). i cant pass the value. what is the solution to do this. thanx in advance.
7
5616
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 I'm not able to get any thing how to use cURL to send the query to remote server and getting back the result of the query. thank in Advance.
4
3302
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 if I need to make each element in each record a unique name/identifier. Right now I was just trying to figure out what the query string looks like when it arrives at the server. I kind of see the errors of my ways, but would like some...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.