Re: Running PHP in custom www server app

From: Nikolai Chuvakhin (nc_at_iname.com)
Date: 09/14/04


Date: 13 Sep 2004 15:38:45 -0700

Paavo Helde <nospam@ebi.ee> wrote in message
   news:<Xns956367777B802paavo256@194.126.101.124>...
>
> We are developing a (Win32) C++ application which among other things is
> able to generate some HTML pages and send them to an HTML client (in the
> same app actually). Now for more flexibility we would like to filter the
> generated pages through PHP.

Please clarify what you are referring to as "filtering" pages through
PHP. It sounds like you want to generate PHP code to be executed, but
I am not sure...

Also, you forgot to mention what HTTP server you are using... PHP can
be deployed on a variety of servers, quite often in more than one way
(CGI binary vs. module on Apache, CGI executable vs. ISAPI module on
IIS)...

> What should be the best/easiest way to proceed?

Assuming you want to generate (and then run) PHP code, the easiest way
would be to pass a chunk of PHP code via POST to this simple snippet:

<?php
  eval($_POST['code']);
?>

Obviously, you may want to implement some security checks (i.e., send
additional data to be used for authentication).

Cheers,
NC



Relevant Pages