我正在使用CodeIgniter創建一個論壇頁面(新增功能),但是一旦用戶提交了評論並刷新頁面,點擊「繼續」到「確認表單重新提交「提示。清除瀏覽器緩存以防止表單重新提交
我向控制器的方法添加了以下內容,但瀏覽器緩存中的發佈數據未被清除。
$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Pragma: no-cache");
我在做什麼錯?請幫忙。
感謝
請參閱https://en.wikipedia.org/wiki/Post/Redirect/Get – TechJS