Forum Moderators: coopster
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
However, I'd like to set my system up so that PHP was processed after a CGI document was finished being processed. Is this possible? Are there any good solutions?
Here's what I'm getting at: At this point, the cgi document merely posts the php code as a comment in the html that is served up. So, when you go to look at the source, you see the actual PHP code. I'd like for the php code to actually be processed (instead of showing up as comment).
Thanks for any help.
Gecko
Better description of the problem:
for cgi to execute, you have to enable cgi for a file type... once you do this, you have to send what the content type is. But the output is still generated from the cgi script, however, this is where apache goes ok, lets just send this back to the browser. It has no clue that you are trying to generate php which is handled by a different module or cgi script...... your best bet if you NEED to do this is generate the code, write it to a file, then redirect to that new file.
noSanity
I'm stuck with a UBB.classic discussion board which uses CGI. I'd like to be able to use a php random generator to place random donation values in a text box ($20, $30,$40, ...) up at the top of the board.
Here's the other deal:
I'd like to play around with Andreas' Getting rid of those query strings code to see if I can turn UBB's dynamic query strings into static URL's.
Any thoughts/help is appreciated.
An easy way to include output of a script or program run via CGI is to use virtual() [php.net]. But this will not return the output of the CGI script to your PHP [php.net] script but directly to the server. To capture the output of a CGI script use output buffering and include the CGI resource or request it using the CURL functions or use backticks and a call to "wget -q -O /dev/stdout [aaron.com...]
Andreas
<added>I wrote that before Gecko´s explanation.</added>