public function home($any = '') {
$this->session->set_flashdata('error', '')
$this->load->view('samples/test');
}
public function send() {
$this->load->library('form_validation');
if($this->form_validation->run()) {
//do your stuff here
} else {
$std = new stdClass(); // just and example (to show that flash_data can hold complex values)
$std->error = 'some error';
// you can get the validation messages from form_validation
// $std = validation_errors(); //just uncomment this part, this should work
$this->session->set_flashdata('error', $std);
}
redirect(base_url('index.php/sample/home#anchor'));
}