gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP interface...for GNOKII not SMSD


From: BORBELY Zoltan
Subject: Re: PHP interface...for GNOKII not SMSD
Date: Thu, 23 Oct 2003 00:19:37 +0200
User-agent: Mutt/1.4.1i

Hi,

On Wed, Oct 22, 2003 at 11:59:16AM +0100, Paulo Orvalho wrote:
> This is how a get so far , it sends the sms but no response in browser
> if it suceeded or not...
> 
> If someone can help thanxx..

I'm not a php programmer, just a quick look into the php manual:

    http://www.php.net/passthru

> <?php
> //Gnokki PHP Sender by Paulo Orvalho
> //20 minutes
> //set_time_limit(20*60);
> //Gnokii command line
> $gnokii = "/usr/bin/gnokii";
> $command ="echo $message | ".$gnokii." --sendsms $phone";
>          passthru($command." 2>&1");

You have to get the return status of the gnokii command: add a second
argument to the passthru function. BTW using user input ($message
variable) without escaping in this way is quite dangerous.

Don't forget if you run gnokii directly from a web page can create
concurrency problems. Don't forget to activate locking. If I were
you I use smsd instead of it. smsd is a stand alone daemon (e.g.
you can start it from an init script) and you can communicate with
it via an sql database (e.g. mysql, postgresql). Look into the
smsd/README file for details!

Bye,
Bozo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]