Re: gather reply from POST
| From: | Richard Lynch | Date: | Wed, 18 May 2005 20:25:00 +0000 |
| Subject: | Re: gather reply from POST | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-215529@lists.php.net to get a copy of this message | ||
On Wed, May 18, 2005 11:55 am, Jeremy Reynolds said:
> I received this useful bit of code for storing a page into a variable
> instead of loading it as an include. But how can I modify this to
> submit some parameters to a page and collect the returned page / HTML
> into a variable??
>
> Jeremy
> --------------
> <?php
> /** DocumentB.php */
>
> $text = file_get_contents('DocumentA.php');
> echo $text;
>
> ?>
Try:
<?php
$foo = 1;
$bar = 2;
$text = file_get_contents("DocumentA.php?foo=$foo&bar=$bar");
echo $text;
?>
If that doesn't work, go to http://php.net/curl
--
Like Music?
http://l-i-e.com/artists.htm