Page 1 of 1

exec cgi? running cgi scripts from a .php page

Posted: Sun Sep 29, 2002 9:19 am
by Stephanie Jones
I'm a complete begginner with regards to php.

I'm converting my homepage from shtml to .php and I can't get my cgi scripts to execute on the page, all I get is the script.
In ssi I was using:

<--exec cgi=("myfile/location/etc")-->

Can anyone tell me how to run the script using php?

I can call text files with :

<?php
require ("myfile/location/ect.txt");
?>

But when I use it to display the text output of a .cgi file it just displays the text of the script.
Please help.. :)

Posted: Sun Sep 29, 2002 10:13 am
by volka
take a look at the various exec functions at http://www.php.net/manual/en/ref.exec.php

Posted: Sun Sep 29, 2002 6:51 pm
by Stephanie Jones
Thanks for your help :D
I finally managed to execute the file using:

<?php
system ("cgi-bin/myfile/location/ect.cgi");
?>

Funny, I'd been to that page earlier and must have missed that bit.
Learning is great fun, but I think I need some matchsticks to keep my eyes open.
Wish me luck..!! he he.

Thanks again