php exec继续加载

时间:2016-07-27 04:34:24

标签: php exec

我正在处理一些代码来运行.bat文件,但出于某种原因,该页面一直在加载

<?php if (!empty($_POST)){ 
$myfile = fopen("search.bat", "w") or die("Unable to open file!");
$loc = $_POST["loc"];
$txt = "my bat code";
fwrite($myfile, $txt);
fclose($myfile);
exec("search.bat");
echo "seaching";
}



else{ ?>
    <form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="post">
        loc: <input type="text" name="loc"><br>
        <input type="submit">
    </form>
<?php }; ?>

0 个答案:

没有答案