Re: Posting data through PHP scripts
| From: | Krzysztof Kocjan | Date: | Mon, 03 Sep 2001 15:24:40 +0000 |
| Subject: | Re: Posting data through PHP scripts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65759@lists.php.net to get a copy of this message | ||
I've never used method virtual but it seems to fit Your problem.
Explanation below.
Krzysztof Kocjan
virtual
(PHP 3, PHP 4 >= 4.0b1)
virtual -- Perform an Apache sub-request
Description
int virtual (string filename)
virtual() is an Apache-specific function which is equivalent to
<!--#include virtual...--> in mod_include. It performs an Apache
sub-request. It is useful for including
CGI scripts or .shtml files, or anything else that you would parse
through Apache. Note that for a CGI script, the script must generate
valid CGI headers. At the
minimum that means it must generate a Content-type header. For PHP
files, you need to use include() or require(); virtual() cannot be used
to include a document
which is itself a PHP file.
Jean Madson wrote:
> I have been thinking about a thing. If I have a PHP script (a)
> which receives some data by a POST method only -- GET method
> is track to not be accepted --, and if I have another PHP script (b)
> that takes initial input from the user's browser... Well, the
> question is: how can I, in the script "b", take the input data and
> post it to script "a" and receive its response,
> following by processing it and giving back the response
> to the browser? The user wouldn't see the action of script "a"
> in any way. To the user, only script "b" would exist. I think
> I can do this by using Delphi, but in PHP this task seens to be
> a nightmare.
>
> browser ==input==> b ==post==> a...
> ...a ==response==> b ==response==> browser
>
> Is this possible with PHP 3 or later?