CodeIgniter Forums
comment form submission - return to same page - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: comment form submission - return to same page (/showthread.php?tid=47859)



comment form submission - return to same page - El Forum - 12-25-2011

[eluser]Unknown[/eluser]
Hello!
how can i redirect my page to the current url after submitting the comment form?

This is the controller function:
Code:
$this->rehber_model->comment();
redirect('this-one-should-be-dynamic');

This is the model function:
Code:
public function comment()
{
$data = array('comment' => $this->input->post('comment'));
return $this->db->insert('comments', $data);
}

Or any other idea for comment system?