php - Fatal error: Call to undefined function validation_error() -
i try use codeigniter, , when use 'validation_error();' it's show 'fatal error: call undefined function validation_error()' on browser.
view code,
<?php echo form_open('main/login_validation'); echo validation_error(); echo "<p>email: "; echo form_input('email'); echo "</p>"; echo "<p>password: "; echo form_password('password'); echo "</p>"; echo "<p>"; echo form_submit('login_submit', 'login'); echo "</p>"; echo form_close(); ?>
this controller,
public function login_validation(){ $this->load->library('form_validation'); $this->form_validation->set_rules('email', 'email', 'required|trim|xss_clean'); $this->form_validation->set_rules('password', 'password', 'required|md5|trim'); if($this->form_validation->run()){ redirect('main/members'); } else{ $this->load->view('login'); } }
and 1 of autoload,
$autoload['helper'] = array('form', 'url');
please :(
Comments
Post a Comment