I'm trying to execute a perl cgi from within 2 PHP scripts using either system() or exec().
one php script executes the other php script which then should excute the perl cgi through a simulated form post using the header function. it works when the header is used in a plain php script but fails whenever the second script is executed using system() or exec(). I can't execute the cgi directly :
exec("/usr/local/perl /path/perl.cgi $var1 $var2"); as it expects var/value pairs and I don't know perl enough to recode the script.
Any Ideas ?
calling script:
<?
// calling script
execute="/home/myaccount/www/clearzone/admin/encryp.php";
exec("/usr/local/php -q $execute test &");
// or
//system("/usr/local/php -q /home/myaccount/www/clearzone/admin/encryp.php test");
?>
encryp.php
<?
// use header to send var/value pairs to perl script
$subject=test;
$redirect="final.php";
Header("Location: ../enc.cgi?subject=$subject&redirect=$redirect");
?>
Many thanks,
Peter