为什么第二个PHP输入提交不工作


why the second php input submit is not working?

我有一个表单在我的html页面上运行一个php页面,并在一个Iframe上实时显示结果,操作是长约20分钟,我试图实现第二个按钮,停止运行杀死进程,php函数工作,但问题是,如果我点击停止按钮的功能不启动。这里的HTML:

 <div id="allign">
      <iframe id="frame" name="my_iframe"  height="520" width="1100" allign="right"  frameBorder="0" ></iframe>
 </div>

<form action="action_calibration.php" method=post  target="my_iframe">
<br><br>
  <input type="radio" name="type" value="fast" checked>Fast Calibration
<br><br>
  <input type="radio" name="type" value="old">Old Calibration
<br><br>
  <input type="checkbox" name="ScanVPlus" value="yes" checked>Scan Vcth vs VPlus
<br><br>
  <input type="checkbox" name="Bitwise" value="yes">Bitwise Offset Tuning
<br><br>
  <input type="checkbox" name="All_channel" value="yes">Calibration using all channel
<br><br>
Output Folder:<input type="textfield" name="output" value="Results/">
<br><br>
Hw Description File:<input type="textfield" name="Hw Description File " value="settings/Calibration2CBC.xml">
<br><br>
  <input type="submit" name="exec" value="Submit">
  <input type="submit" name="exec1" value="STOP">
<br><br>
</form> 

action_calibration.php文件的最后一部分是这样的:

$handle = popen("source ".$command, "r");
$continue=TRUE;
while ((!feof($handle))&& $continue) {
    $data = fgets($handle);
    print $data."<br/>";
    echo $continue;
    if(isset($_POST['exec1'])){
     $continue=FALSE;
   }   
}
shell_exec("kill $(pidof calibrate)");

谢谢你的帮助。

试试这个......

 <input type="submit" name="exec" value="Submit">
 <input type="submit" name="exec1" value="STOP">
 $handle = popen("source ".$command, "r");
 $continue=TRUE;
 while ((!feof($handle))&& $continue) {
 $data = fgets($handle);
 print $data."<br/>";
 echo $continue;
 if(isset($_POST['exec1'])){
 $continue=FALSE;
 }   
}
shell_exec("kill $(pidof calibrate)");