Hi I would appreciate help on the following.
I have php page which has a form. In addition it also
calls a perl file with a line in a function like
exec("myperfile $var1 $var2 $ var3");
each time the form is submitted
This works fine. However the perl file takes a long time
to execute and I do not want the user to have to wait a
long time before submitting the next request on the same form.
I have tried to look at how to do this and have found that
a lot of people say to use something like
exec("myperfile $var1 $var2 $ var3 </dev/null &>/dev/null &");
using the '&' at the end to make the perl file run in the background.
I have tried this and have tried different variations on the switches. Everytime I hit the button which refreshes the form
to try to make another submission the current form gets interrupted and all of the code that goes on after the form is
submitted gets stopped.
this is the code I use to refresh the page
$headerHTML.="<script type='text/javascript'>";
$headerHTML.="function refresh(){";
$headerHTML.="window.location.href = 'array.php'";
$headerHTML.="}";
$headerHTML.="</script>";
$headerHTML.="<input type='button' name='$activeRefresh' value='Add' onClick='refresh()'>        \n";
I do not want to use the pcntl_fork function. This & option with exec seems to work for several people but not me. What am I missing?
I was thinking of using the the
exec("wget -q --spider $url $var $var"); but this does not work well for me either.
This is very frustrating.
thanks in advance