I might also recommend trying CURL for calling Kannel. I've used for both GET and POST and had no issues as of yet.

-andrew

On Oct 18, 2007, at 10:25 AM, Alejandro Guerrieri wrote:

Why are you redirecting with a header?

Use file_get_contents( $url ) or file( $url ) to call kannel.

Alternatively, use sqlbox and insert a row for each message to send
(if you pretend to send a high load of messages that's definitely the
way to go).

Regards,

Alejandro

On 10/18/07, Raphael Maseko <[EMAIL PROTECTED]> wrote:

Hi All,

I am trying to use kannel to send multiple SMS' with different content
retrieved from a database.

I have a php script that is accessing a database and retrieving a value corresponding to a mobile number. It is then supposed to send SMS's to the
numbers retrieved.

What is happening is that it will only send the first one and stop. No error is given. I have tried to remove the 'function send_many_sms' and use and include with the 'hearder (location)' but getting the same error. I am
calling the php file using lynx.

I know that this may not be strictly a kannel issue but I would appreciate
pointers. Thanks for your help in advance.

Ralph

----------




<?php

function send_many_sms($to, $message)
{
ob_start();


header("Location:http://1.2.3.4:13013/cgi-bin/sendsms? username=username&pass
word=password&to=$to&text=$message");
        ob_get_flush();
         flush();
}

if (!$link = mysql_connect('localhost', 'user', '')){echo 'Could not
connect to mysql';
               exit;
        }

        if (!mysql_select_db('DBase', $link)) {
               echo 'Could not select database';
               exit;
        }


SELECT STATEMENT HERE


if (!$result) {
                echo " DB Error, could not query the Database\n";
                exit;
        }
        else
        {
                while ($row = mysql_fetch_assoc($result))
                {
                        $to=$row['MobileNumber'];
                        $Balance = $row['Value'];
                        $message="Your balance is ".$Balance;

                        send_many_sms($to, $message);
}


        mysql_close($link);
}






--
Alejandro Guerrieri
Magicom
http://www.magicom-bcn.net/
LinkedIn: http://www.linkedin.com/in/aguerrieri



Reply via email to