Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16067

Re: how to retreive posted data in php

From Tim Streater <timstreater@greenbee.net>
Newsgroups comp.lang.php
Subject Re: how to retreive posted data in php
Date 2016-01-04 19:26 +0000
Message-ID <040120161926273863%timstreater@greenbee.net> (permalink)
References <ccb445fa-b0ce-44ae-8e19-03cd99b477d5@googlegroups.com>

Show all headers | View raw


In article <ccb445fa-b0ce-44ae-8e19-03cd99b477d5@googlegroups.com>,
<androidmaroso@gmail.com> wrote:

>Hi, I know this question is very stupid but i'm breaking my head on this all
>afternoon.
>
>I built a page in php with the code below and want this page to read the
>parameter passed to it and send the whole URL so that my message from telegram
>gets sent.
>
>I can't get it working! 
>
>This works if i write it in the browser and press enter :
>https://api.telegram.org/bot177125014:AAHpx9FyKMK4WaT4pXQ29WfrRLM4w7nZEcA/sendM
>essage?chat_id=164428169&text=hello world
>
>
>
>This is the code of my php page....please help!
>
><?php
> 
>$testo=$_POST["msg"];
>printf ($testo);

This printf will prevent the header () that you have below from
working. NO output may precede a header.

>
>//create a url variable that will store all values
>//since you are going to send them as part of a single url 
>$url="";
>
>header("location:
>https://api.telegram.org/bot177125014:AAHpx9FyKMK4WaT4pXQ29WfrRLM4w7nZEcA/sendM
>essage?chat_id=164428169&text=".$testo);
>
>printf
>("https://api.telegram.org/bot177125014:AAHpx9FyKMK4WaT4pXQ29WfrRLM4w7nZEcA/sen
>dMessage?chat_id=164428169&text=".$testo);
>
>?>

-- 
"... you must remember that if you're trying to propagate a creed of 
 poverty, gentleness and tolerance,  you need a very rich, powerful,
 authoritarian organisation to do it."             - Vice-Pope Eric

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to retreive posted data in php androidmaroso@gmail.com - 2016-01-04 11:04 -0800
  Re: how to retreive posted data in php Tim Streater <timstreater@greenbee.net> - 2016-01-04 19:26 +0000
  Re: how to retreive posted data in php Mi Na <ya12983@mail.com> - 2021-07-23 00:54 -0700

csiph-web