我有一個我想加載並顯示一段時間的頁面。然後應該將用戶重定向回索引視圖。如何使用PHP和codeigniter在一段時間後重定向用戶?
下面的代碼是我的控制器。
function send()
{
$data = array(
'author' => $_POST['author'],
'header' => $_POST['header'],
'paragraph' => $_POST['paragraph']
);
$result = $this->database_model->insert_into_articles($data);
if($result)
{
$view['content'] = "articles_send_view";
$this->load->view('includes/template',$view);
}
}
以下是我的看法。
<div id="content">
<div id='other_content'>
<p>
article sent thanks
</p>
</div>
我不明白問什麼。你是否要求頁面加載被延遲?你問如何重定向? – Nightfirecat
你需要看看阿賈克斯呼籲 – Sparkup