Forum Moderators: coopster & phranque

Message Too Old, No Replies

Including a PHP script within CGI script

         

branmh

2:18 pm on Sep 22, 2003 (gmt 0)

10+ Year Member



How would I include a PHP script within a CGI script?

jeremy goodrich

12:07 am on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Afaik, can't be done.

Though, I only do Perl, so perhaps somebody more familiar with PHP / or the integration of the 2 can give you a more hopeful answer?

Storyteller

4:35 am on Sep 23, 2003 (gmt 0)

10+ Year Member



branmh, that depends on what you want to do. If you want PHP's script output, you can call PHP's standalone binary using, say, backquotes:

#!/usr/bin/perl
...do your stuff..
$php_output = `/usr/bin/php myscript.php`
...do your stuff..

If you need to parse a very simple PHP file for variable values, there's PHP::Include module on CPAN.