• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

How can I call CGI for SSI?

Zoom

New Member
I have index.php3 and I have to input CGI-script's results into php. How can I do it?(SSI in php doesn't work)

Help me, please!
 
You can try to use a script call, i.e.:

<script src="some_cgi.pl"></script>

This will work with most perl files, but not all. The other alternative is just grabbing the results of a cgi call, like grabbing an html page from somewhere, and then puting that into your PHP generated page.

The first method should work most of the time and is client side so it does not require an SSI extension. The second will always work, but requires a little more programming and a little more computation time.

[Edited by cds on 11-04-2000 at 08:39 AM]
 
I think there is an INCLUDE statement in php where you can include scripts (perl, php...) into your web pages...
 
Originally posted by Semiel
I think there is an INCLUDE statement in php where you can include scripts (perl, php...) into your web pages...

I think that it's <?virtual("/cgi-bin/script.pl")?> or maybe <?include("/cgi-bin/script.pl")?>, but I think it's the virtual one.
 
try this...

try this <? include("http://domain.com/test.cgi"); ?>

it will work must use the URL and not the path...
 
The method I mentioned first is client side, so that should work. The other method I mentioned is what the others have mentioned with the include directive.

Try the second method first, then the first. PHP has funny ways of disbehaving sometimes so you may have to play with it. Definately check out the link that Semiel graciously found. The PHP manuals usually have loads of user comments after the directives so you can see how other people implemented the commands. Good luck! :)
 
Well, not a lot of people have used the PHP's Include directive for PERL, so maybe thats another bug with PHP (although I think it should work).

Instead, try fsockopen to stream the data into your script, then printing out the results within your PHP output.
 
Back
Top