RE: [PHP] Executing a CGI inside a PHP page (Again?)
| From: | Krznaric Michael | Date: | Wed, 02 Aug 2000 18:43:24 +0000 |
| Subject: | RE: [PHP] Executing a CGI inside a PHP page (Again?) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9781@lists.php.net to get a copy of this message | ||
Hi Andres,
I have the same problem. I have a template site and am too lazy to
rewrite my CGI's. What I did, since performance is not an issue, is open an
HTTP request to my webserver and send POST or GET to the appropriate script.
This way i can be sure there are no side affects. However, I'm sure almost
everyone reading this would agree, that there isn't a more INEFFICIENT way
to do this.
With respect to executing the script. I think you need to set the
environment variable QUERY_STRING. And if your cgi scripts is expecting the
result from a POST method then i think you need to send the arguments to
STDIN for that CGI. Any corrections, addendums, to this info are welcome.
MIke
-----Original Message-----
From: Andrés Sulleiro [mailto:andres@sulleiro.com]
Sent: Wednesday, August 02, 2000 2:39 PM
To: PHP List
Subject: [PHP] Executing a CGI inside a PHP page (Again?)
Hi,
I am new to the list and maybe this has been discussed to death, if so, I
apologize for bringing it up. This is the deal:
I have a meta search CGI script that queries several search engines and
returns formated results. Since I have a template based site, I wanted to
call the CGI from within the PHP page (wich creates most of the site's
necesary personalization).
I have succesfully included the script in my PHP page, but my problem comes
when I execute the CGI. A typical CGI form would pass on the arguments
directly to the CGI, but now I would have to submit the search form to the
PHP and then pass the arguments to the CGI and execute it and return the
results. Here is where the problem lies. when I do a getenv(QUERY_STRING)
and pass it on the CGI it gives me a blank page, and no errors.
Is the CGI able to process the arguments, execute the script, and return the
results to the PHP page?
Note that the CGI uses a couple other perl scripts and an HTML page as
template to generate the results' look.
This works fine:
system("/script/path/program.cgi")
But this returns a blank page:
system("/script/path/program.cgi?search=value")
Could anybody help me?
Thanks!
--Andrés.
andres@sulleiro.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net