p>
<?php
$ time = $ _ GET ['time'];
$ date = $ _ GET ['date'];
if($ time!=” “& $ date!=”“){
$ hour = s ubstr($ time,0,2);
$ minute = s ubstr($ time,3,2);
\ n $ day = substr($ date,8,2);
$ month = substr($ date,5,2);
$ year = substr($ date,0,4);
$ execute = exec(“python .. \ alarm.py $ year $ month $ day $ hour $ minute”);
}
?>
< form action =“index.php”method =“get”>
< input type =' date'name ='date'>
< input type ='time'name ='time'>
< input type ='submit'value ='setAlarm'>
\ n< / form> code> pre>
div>
div>
所以我正在处理一些应该做的代码 以下内容: p>
- 单击index.php上的Submit-button应执行存储在Server上的python脚本并提交表单的参数 li>
- python脚本,它是一个连续发出警报的脚本(它设置一个警报等到那时执行它 - >所以它应该一直运行直到警报结束) li>
- 从php脚本启动python脚本之后,index.php应该重新加载。 li>
ol>
现在,一切正常,无需重新加载 index.php。 文件正在执行,手动重新加载页面后,index.php显示所有正在运行的alarm.py脚本,这就是我想要的。 p>
所以有办法,强迫 重启页面,从php开始执行后? p>
div>