Re: Running scripts from within PHP similar to SSI
| From: | Richard Lynch | Date: | Mon, 25 Jun 2001 07:11:14 +0000 |
| Subject: | Re: Running scripts from within PHP similar to SSI | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55101@lists.php.net to get a copy of this message | ||
If you are running PHP as a Module (you should be) try the
http://php.net/virtual function.
If not, you can use exec(), but pass any vars the thing needs:
# Your CGI may be expecting command-line args or flags or...
# I presumed it was URL-style input.
exec("./cgi-bin/txtcounter.cgi?foo=$foo&bar=$bar", $results, $error);
while(list(,$line) = each($results)){
echo $line, "<BR>\n";
}
if ($error){
echo "txtcounter.cgi returned OS error $error. Usually
paths/permissions.<BR>\n";
}
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Bilal Deniz <penggu@iname.com>
Newsgroups: php.general
Sent: Sunday, June 24, 2001 1:04 AM
Subject: [PHP] Running scripts from within PHP similar to SSI
> Hi All,
>
> Just wondering if it were possible to do like the following SSI line:
>
> <!--#exec cgi="./cgi-bin/txtcounter.cgi"-->
>
> from within php.
>
> I know a php alternative should be made, but for the time being and for
> future's sake....
>
>
> So far i've tried back ticks, passthru(), exec(), but the problem is
> that the URI and other variables aren't being passed to the perl script
> in question.
>
> Any idea would be appreciated.
>
> Deniz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>