0

header() を使用すると、srcipt の実行が終了した後に拒否されました。インクルードと同じで、html を使用してそこに php を配置しても、php の終了後に iframe が機能します。

<?php 
header("Location: localhost/index.html");
sleep(120);
doSomethingUsefull();
?>

index.html が 120 秒後にビルドされる前のサインとして。何かを含めてレディクテットを取得し、スクリプトの実行を継続できる他の方法はありますか?

4

1 に答える 1

0

これはどうですか?

<?php 
    header("Location: localhost/index.html");

    session_write_close();
    fastcgi_finish_request();

    sleep(120);
    doSomethingUsefull();
?>
于 2013-10-07T16:38:20.723 に答える