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 [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to