Re: _GET/_POST vars passed to PHP how?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: _GET/_POST vars passed to PHP how?

From: Bush is a Fascist <z333r@yahoo.com>
Date: Wed Jul 20 2005 - 23:24:37 CEST

Gordon Burditt wrote:

> If PHP is run as a CGI, it's done by the interface defined by CGI:
> GET variables show up in environment variables (the CGI has to
> separate them), and PUT variables are available on stdin (again,
> the CGI has to separate them). Environment variables indicate
> whether this is GET or PUT and how much input is available on
> stdin.

As an experiment I wrote a simple C program that invokes
PHP, but I'm getting an error "No input file specified.".

What I do is:

setenv ("REQUEST_METHOD", "GET", 1);
setenv ("QUERY_STRING", "abc=123", 1);

and then I invoke PHP thus:

system "/usr/local/bin/php myfile.php < dummyfile > foo";

and I also tried:

system "/usr/local/bin/php myfile.php dummyfile > foo";

where dummyfile is either empty or just contains the line
"abc=123".

This is very odd. Any idea as to why I'm getting
this error?

Thanks,
333
Received on Mon Oct 17 21:13:00 2005