Hi Jarl,

Yes sorry misunderstood - from docs check the headers ... ie:

Kannel POST
Kannel can do POST if service is contains a post-url="...".

Table 5-9. X-Kannel Post Headers


Parameter (escape code)
equivalent
X-Kannel Header
Notes
%p (from)
X-Kannel-From
Only sent if send-sender
is true
%P (to)
X-Kannel-To
...

So you'll probably want to look at the HTTP_X_KANNEL_... php variables.
phpinfo() is useful to see the details of the raw request (these are
also in the _SERVER array I believe). 

HTH,
Alan

On Tue, 2003-11-18 at 13:15, Jarlco wrote:
> Hmm I think I've been misunderstood...
> first of all, the problem isn't really my php skills I don't think... I'm
> using _POST for post-url and _GET for get-url obviously.
> No, the problem is that when sending data from kannel to php with get it's
> easy enough cause you can see what you're sending and in which format:
> get-url = localhost..../jarl.php?from=%.... to=%.... etc...
> however as far as I know that's not how it works with post-url...
> 
> so the question is, how do I get the stuff like from, to, time etc off the
> message and sent to php with post-url?
> with get it's easy and I can easily store it to my file using:
> <?
> > $data=print_r($_GET, true); // Prints the array to the variable $data
> > ('true' puts it in the variable)
> > $filea = fopen("newmsg.txt","a"); // Open file in append mode (don't
> > overwrite)
> > fwrite($filea, $data); // Write data
> > fclose($filea); // Close file
> > ?>
> 
> now why wouldn't this work:
> kannel.conf:
> group = sms-service
> keyword = nop
> text = "You asked nothing and I did it!"
> post-url = http://localhost/kannel/jarl.php
> 
> php script:
> <?
> > $data=print_r($_POST, true); // Prints the array to the variable $data
> > ('true' puts it in the variable)
> > $filea = fopen("newmsg.txt","a"); // Open file in append mode (don't
> > overwrite)
> > fwrite($filea, $data); // Write data
> > fclose($filea); // Close file
> > ?>
> 
> with this I get nothing but the following in my text file:
> Array
> (
> )
> 
> so nothing really, thanks for enlightening me on the how post-url works with
> kannel, get-url as I said is easy cause you just send the stuff along with
> the url like:
> #get-url = "http://localhost/kannel/jarl.php?from=%p&to=%P
> and with that I get:
> Array
> (
>     [from] => 00123
>     [to] => 00345
> )
> 
> in my file.
> 
> Cheers for any more help,
> Jarl
> "Alan McNatty" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi Jarlco,
> >
> > With HTTP post try using _POST not _GET array varsx. You might also want
> > to look at HTTP_RAW_DATA_POST (phpinfo() may also be useful).
> > Cheers,
> > Alan
> >
> > On Tue, 2003-11-18 at 11:54, Jarlco wrote:
> > > How does kannel use post-url ?
> > >
> > > My earlier post might have been long for a short problem... in shorter:
> > > I know get-url works like this:
> > > get-url = http://localhost/kannel/jarl.php?from=%p&to=%P
> > > now how does post-url work? can't seem to get that to work with just:
> > > post-url = http://localhost/kannel/jarl.php
> > >
> > > php script is:
> > > <?
> > > $data=print_r($_GET, true); // Prints the array to the variable $data
> > > ('true' puts it in the variable)
> > > $filea = fopen("newmsg.txt","a"); // Open file in append mode (don't
> > > overwrite)
> > > fwrite($filea, $data); // Write data
> > > fclose($filea); // Close file
> > > ?>
> > >
> > > now with GET it works and with POST I'm confused as I get nothing in my
> > > newmsg.txt file
> > >
> > > Cheers for any help on how kannel posts stuff,
> > > Jarl
> > >
> > > "Jarlco" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > >
> > > > Thank you all for your eariler replies, finally understood most of it
> and
> > > > managed to get a bit further on my kannel project.
> > > >
> > > > However I've now run into a problem with sending information from
> kannel
> > > to
> > > > a php script. My script simply takes anything posted to php and saves
> the
> > > > output to a file...
> > > > this is using: print_r($_POST);
> > > > Now, the problem is that it doesn't seem to work using post but using
> > > > print_r($_GET); works fine (but then I have to include &from=% etc in
> the
> > > > url.
> > > >
> > > > The way I've done this is like the following:
> > > > group = sms-service
> > > > keyword = default
> > > > get-url =
> > > >
> > >
> "http://localhost/jarl.php?from=%p&to=%P&keyword=%k&body=%r&mccmnc=%B&smscid
> > > > =%i&fullbody=%a"
> > > >
> > > >
> > > > (have tried with catch-all = true as well, doesn't seem to make a
> > > > difference)
> > > >
> > > > What I would like to do is:
> > > >
> > > > group = sms-service
> > > > keyword = default
> > > > post-url = http://localhost/jarl.php
> > > > catch-all = true
> > > >
> > > > However this outputs nothing in my file compared to:
> > > > (when I use the get-url option)
> > > >
> > > >     [from] => 123
> > > >     [to] => 345
> > > >     [keyword] => default
> > > >     [body] =>
> > > >     [mccmnc] =>
> > > >     [smscid] => FAKE
> > > >     [fullbody] => default
> > > >
> > > > Now, of course I could go on using get-url, however I would like to
> > > > understand how the post function works and I prefer using post if
> > > possible.
> > > >
> > > > Cheers,
> > > > Jarl
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> >
> >
> 
> 
> 
> 


Reply via email to