exec cgi? running cgi scripts from a .php page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Stephanie Jones
Forum Newbie
Posts: 2
Joined: Sun Sep 29, 2002 9:19 am
Location: UK

exec cgi? running cgi scripts from a .php page

Post 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.. :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

take a look at the various exec functions at http://www.php.net/manual/en/ref.exec.php
Stephanie Jones
Forum Newbie
Posts: 2
Joined: Sun Sep 29, 2002 9:19 am
Location: UK

Post 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
Post Reply