First of all, I am a French student, so excuse me for my poor English level.
We are currently developing a web server (C ++), and I have to develop the implementation of the CGI part, more precisely: the PHP CGI part.
When the user requests the .php page on our server, we use fork / pipe and call the / usr / bin / php translator. For instance:
$ / usr / bin / php index.php
Now we can save the result in a buffer (generated html code index.php), and I can send this content to the client. It works for a simple script without any variable.
However, many PHP scripts use some superglobal, such as $ _GET and $ _POST. My problem: how can I pass this argument to the php interpreter?
Example. How can I set this $ _POST variable in order to save "Hello world" to our buffer?
<?php echo $_POST['text']; ?>
Thanks for your future answers.
Cordially
source share