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();
}
?>
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/
"Jochen Daum" <joche...@cabletalk.co.nz> schrieb im Newsbeitrag
news:afh670df4bim1g5lm...@4ax.com...
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
Is there a way to do without???
Stefan
I think I have mentioned Snoopy on Sourceforge. Have you looked that
up as well?
Jochen
>
>Stefan
Stefan
If the company does not provide https on their server,
code on your end won't help.
Gordon L. Burditt
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
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...
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
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,
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
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.