Well,
I am trying to understand what you want to do here.
If you want to test your script from PHP (by simulating the sending of
different values, for example), the correct PHP function to use is
fopen(), not file(). fopen() allows you to open a URL; thus, the first
argument of the function will be something like "http://yoururl".
However, if what you want to do is capture the result that Kannel will
actually send to the phone that sent the SMS, then you need to do it in
the script itself, i.e. the file that you mentionned in the request url
specified for the service. What I do myself is that after processing the
SMS, I store the wanted answer in a variable and I do whatever I want
with it (storing it in a database, for example), and at the end of the
script I just 'echo it', specifying the content type of the result.
ex:
<?php
// get the variables from the url
// process them and store the wanted answer in a variable
$answer = whatever;
// store the answer in a database or whatever
// then specify the content type and echo the variable
header('Content-type: text/plain'); // here the content is plain text
echo $answer;
?>
Your $answer will be stored in your database, and Kannel will send back
the $answer to the originating phone. Just be sure not to echo or print
anything before the header() call.
Stéphane
[EMAIL PROTECTED] wrote:
Hello everybody,
I want to get kannel's answers when sending sms and save them on a database.
But if I use file() function on the request url it doesn't work.
Could anybody explain why?
How you get those ansvers?
Thank You!
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.