URL を変更する PHP スクリプトを含めています。
// index.php
ob_start();
include "script.php";
// This script redirects using header("Location:");
$out = ob_get_clean();
// I use the $out data for calculations
echo $out;
この不要なリダイレクトに対抗または元に戻す簡単な方法はありますか? どうですか:
header("Location: index.php"); // redirect back to self
しかし、これは無限のリダイレクトループを引き起こします...何かアイデアはありますか?
または、$out バッファから header() 呼び出しを取り除いて、クライアントに到達しないようにする方法はありますか?