How realize form success notify using CodeIgniter?
I have feedback non-ajax 开发者_JS百科form whitch create on CodeIgniter 2. I wanna to show notify after form successful submit. How do this, correctly?
Basic example, this is over-simplified so it can be understood easily:
Controller
if ($this->form_validation->run()) // Your logic that tells if the submit was OK
{
$data['message'] = 'Thanks.';
}
else
{
$data['message'] = 'There was an error.';
}
$this->load->view('my_view', $data);
View
<?php echo $message; ?>
精彩评论