Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMS Sending by SSL Connection

0 views
Skip to first unread message

Stefan Richter

unread,
Apr 6, 2004, 7:57:06 PM4/6/04
to
Hi, I would like to conect to a server by a SSL Conection,
to send an SMS.
The company that offers the SMS service provided some Code for a http
connection, but not for a https connection.

Here is the code to send an SMS by http, which works great.
Can you help / or do you know a good tutorial / website for php and
ssl ???

thanx,
marcus


<?
$user = "user";
$password = "password";
$api_id = "xxxx";
$baseurl ="http://api.clickatell.com";
$text = urlencode("This is an example message");
$to = "0123456789";
// auth call
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data
returned
$sess = split(":",$ret[0]);
if ($sess[0] == "OK") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
// do sendmsg call
$ret = file($url);
$send = split(":",$ret[0]);
if ($send[0] == "ID")
echo "success<br>message ID: ". $send[1];
else
echo "send message failed";
} else {
echo "Authentication failure: ". $ret[0];
exit();
}
?>

Jochen Daum

unread,
Apr 6, 2004, 8:06:30 PM4/6/04
to
Hi,

On 6 Apr 2004 16:57:06 -0700, Doo...@gmx.de (Stefan Richter) wrote:

>Hi, I would like to conect to a server by a SSL Conection,
>to send an SMS.
>The company that offers the SMS service provided some Code for a http
>connection, but not for a https connection.
>
>Here is the code to send an SMS by http, which works great.
>Can you help / or do you know a good tutorial / website for php and
>ssl ???
>

Try the curl extension, or maybe Snoopy on Sourceforge. Both do SSL.

HTH, Jochen

--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/

Stefan Schneider

unread,
Apr 6, 2004, 8:12:20 PM4/6/04
to
I saw something about curl before.
Though - what is curl???


"Jochen Daum" <joche...@cabletalk.co.nz> schrieb im Newsbeitrag
news:afh670df4bim1g5lm...@4ax.com...

Jochen Daum

unread,
Apr 6, 2004, 8:15:52 PM4/6/04
to
Hi,

On Wed, 7 Apr 2004 02:12:20 +0200, "Stefan Schneider"
<mar...@site-ezy.com> wrote:

>I saw something about curl before.
>Though - what is curl???

Its a library that handles all kind of internet protocols, HTTP, FTP,
telnet etc.

There's an extension in php. Check out www.php.net and Google.

HTH, Jochen

Stefan Richter

unread,
Apr 6, 2004, 9:35:45 PM4/6/04
to
Just checked - it's not installed on our server, and I doubt
it will be.

Is there a way to do without???

Stefan


Jochen Daum

unread,
Apr 6, 2004, 9:47:37 PM4/6/04
to
Hi,


I think I have mentioned Snoopy on Sourceforge. Have you looked that
up as well?

Jochen
>
>Stefan

Stefan Richter

unread,
Apr 6, 2004, 10:21:24 PM4/6/04
to
No, I can't install anything new at all.

Stefan


Gordon Burditt

unread,
Apr 6, 2004, 10:38:46 PM4/6/04
to
>Hi, I would like to conect to a server by a SSL Conection,
>to send an SMS.
>The company that offers the SMS service provided some Code for a http
>connection, but not for a https connection.

If the company does not provide https on their server,
code on your end won't help.

Gordon L. Burditt

Manuel Lemos

unread,
Apr 6, 2004, 10:53:30 PM4/6/04
to
Hello,

On 04/06/2004 08:57 PM, Stefan Richter wrote:
> Hi, I would like to conect to a server by a SSL Conection,
> to send an SMS.
> The company that offers the SMS service provided some Code for a http
> connection, but not for a https connection.

There is no need to reinvent the wheel. Here is a class that does
exactly what you want:

Class: Clickatell SMS API
http://www.phpclasses.org/smsapi

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Stefan Richter

unread,
Apr 7, 2004, 12:08:16 AM4/7/04
to
Hi Manuel,

just had a short look on it,
and it really seems to be exactly what I need -
though it also talks about curl -
does that mean that the php file has curl code included,
or does it mean that I still need to install the curl library,
which my supervisor doesn't want me to...


Stefan Richter

unread,
Apr 7, 2004, 12:09:06 AM4/7/04
to
Clickatell provides https on their server,
but I am not allowed to install a lib on our server,
the one that contacts clickatells server.


Jochen Daum

unread,
Apr 7, 2004, 12:19:59 AM4/7/04
to
Stefan,

On Wed, 7 Apr 2004 04:21:24 +0200, "Stefan Richter"
<mar...@site-ezy.com> wrote:

>No, I can't install anything new at all.


And that tells me that you haven't looked, because its just a bunch of
PHP scripts.

Jochen

Stefan Richter

unread,
Apr 7, 2004, 1:18:23 AM4/7/04
to
Oh god I am looking for an example the whole day already!!!
If you know one, could you be so nice to tell me the adress???

Stefan


Jochen Daum

unread,
Apr 7, 2004, 1:20:32 AM4/7/04
to

I'm really getting concerned now. I think you still have not entered
>>>Snoopy sourceforge<<< into Google and I'm not gonna do it for you.

HTH,

R. Rajesh Jeba Anbiah

unread,
Apr 7, 2004, 6:26:21 AM4/7/04
to
Jochen Daum <joche...@cabletalk.co.nz> wrote in message news:<lp3770l800kqfjce6...@4ax.com>...

> On Wed, 7 Apr 2004 07:18:23 +0200, "Stefan Richter"
> <mar...@site-ezy.com> wrote:
>
> >Oh god I am looking for an example the whole day already!!!
> >If you know one, could you be so nice to tell me the adress???
> >
>
> I'm really getting concerned now. I think you still have not entered
> >>>Snoopy sourceforge<<< into Google and I'm not gonna do it for you.

IIRC, Snoopy requires the command line cURL. The OP says he cannot
install anything on his server. So, I'm skeptical that he may not even
use Snoopy either.

The cURL alternative will be fsockopen()
<http://in2.php.net/fsockopen> . The recent PHP versions support
ssl://, but I think for that we need to have openssl enabled.

--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com

Jochen Daum

unread,
Apr 7, 2004, 5:33:19 PM4/7/04
to
Hi Rajesh,

On 7 Apr 2004 03:26:21 -0700, ng4rrj...@rediffmail.com (R. Rajesh
Jeba Anbiah) wrote:

>Jochen Daum <joche...@cabletalk.co.nz> wrote in message news:<lp3770l800kqfjce6...@4ax.com>...
>> On Wed, 7 Apr 2004 07:18:23 +0200, "Stefan Richter"
>> <mar...@site-ezy.com> wrote:
>>
>> >Oh god I am looking for an example the whole day already!!!
>> >If you know one, could you be so nice to tell me the adress???
>> >
>>
>> I'm really getting concerned now. I think you still have not entered
>> >>>Snoopy sourceforge<<< into Google and I'm not gonna do it for you.
>
> IIRC, Snoopy requires the command line cURL. The OP says he cannot
>install anything on his server. So, I'm skeptical that he may not even
>use Snoopy either.

I used Snoopy on a server without curl.

R. Rajesh Jeba Anbiah

unread,
Apr 8, 2004, 12:50:34 AM4/8/04
to
Jochen Daum <joche...@cabletalk.co.nz> wrote in message news:<0ss8705dlqogthasn...@4ax.com>...

> Hi Rajesh,
>
> On 7 Apr 2004 03:26:21 -0700, ng4rrj...@rediffmail.com (R. Rajesh
> Jeba Anbiah) wrote:
>
> >Jochen Daum <joche...@cabletalk.co.nz> wrote in message news:<lp3770l800kqfjce6...@4ax.com>...
> >> On Wed, 7 Apr 2004 07:18:23 +0200, "Stefan Richter"
> >> <mar...@site-ezy.com> wrote:
> >>
> >> >Oh god I am looking for an example the whole day already!!!
> >> >If you know one, could you be so nice to tell me the adress???
> >> >
> >>
> >> I'm really getting concerned now. I think you still have not entered
> >> >>>Snoopy sourceforge<<< into Google and I'm not gonna do it for you.
> >
> > IIRC, Snoopy requires the command line cURL. The OP says he cannot
> >install anything on his server. So, I'm skeptical that he may not even
> >use Snoopy either.
>
> I used Snoopy on a server without curl.

I think, that might be the old version (one without ssl support eg.
<http://turma.sourceforge.net/web/urlator/snoopy.html>).

Just checked their changelog:

Version 0.94
------------
- Added SSL support via cURL
<snip>

And in recent v1.01 <http://sourceforge.net/projects/snoopy/>, they
use commandline cURL for ssl.

0 new messages