Q
延遲和重定向
0
A
回答
1
2
當你在你的控制器方法來設置flashdata,發送時間插件econds:
Controller.php這樣
public function do_something(){
//do somthing
$this->session->set_flashdata('message_id', 'Message');//message rendered
$this->session->set_flashdata('seconds_redirect', 5);//time to be redirected (in seconds)
$this->session->set_flashdata('url_redirect', base_url('controller/method'));//url to be redirected
redirect('folder/temp_view', 'refresh');
}
in your view/folder/temp_view.php
<html>
<head>
<meta http-equiv="refresh" content="<?= $this->session->flashdata('seconds_redurect');?>;url=<?= $this->session->set_flashdata('url_redirect')?>" />
</head>
<body>
<?= $this->session->flashdata('message_id');?>
</body>
</html>
這種傳遞消息的變量,時間要被重定向到另一個網頁,並鏈接到它會被重定向
+0
非常感謝,讓我檢查並回復back.hope這有助於 – youv
+0
告訴我,如果它運行 – elddenmedio
1
我被困在同一個地方:
1.型號本作鑑於文件靜態URL:
<?php
header("Refresh: 5; url=\"http://www.google.com\"");
echo "You will be redirected to google in 5 seconds..."
?>
2,型號此用於視圖文件BASE_URL:
<?php
header('Refresh:5; url= '. base_url().'/create_event');
echo "You will be redirected in 5 seconds..."
?>
相關問題
- 1. 頁面重定向延遲
- 2. 延遲jquery重定向
- 3. Grails重定向延遲
- 4. 延遲重定向頁面
- 5. GAE重定向延遲
- 6. 延遲重定向頁面
- 7. MVC重定向延遲
- 8. HTML時間延遲重定向
- 9. jQuery的延遲重定向MVC的ASP.Net
- 10. 重定向之前的時間延遲
- 11. Interupt一個延遲的javascript重定向
- 12. ajax的jquery延遲鏈接重定向
- 13. Android定時器延遲和重置
- 14. 如何延遲關閉()和重定向之前?
- 15. 如何根據引用來重定向和/或延遲?
- 16. Cumsum重置和延遲
- 17. 與重複和延遲的
- 18. 延遲重繪
- 19. 未設定文字時延遲延遲
- 20. 延遲重試 - RxSwift
- 21. NServiceBus延遲重試
- 22. 延遲重複CAAnimation
- 23. 綁定延遲
- 24. 定製延遲
- 25. EC2延遲和一般延遲
- 26. 相同元素的延遲和延遲?
- 27. runOnUiThread和延遲
- 28. setInverval和延遲
- 29. 春季調度固定延遲和初始延遲的作業
- 30. 提交,顯示結果,延遲3秒,並重定向
嘗試此'標題( 「刷新:5; URL = abc.php」);' – Nagendra