call to undefeined function error - 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: call to undefeined function error (/showthread.php?tid=58980) |
call to undefeined function error - El Forum - 08-11-2013 [eluser]Unknown[/eluser] i've been trying for sometime now, but couldnt find a useful link on why am having this error. Fatal error: Call to undefined function validation_errors() in /Applications/XAMPP/xamppfiles/htdocs/ci/application/views/login_view.php on line 9 i've tried what some solutions that address the same issue, but it turns out that they didnt work on mine. below is my login_view <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html > <head> <title>Simple Login with CodeIgniter</title> </head> <body> <h1>Simple Login with CodeIgniter</h1> <?php echo validation_errors();?> <?php echo form_open('verifylogin');?> <label for="username">Username:</label> <input type="text" size="20" id="username" name="username"/> <br/> <label for="password">Password:</label> <input type="password" size="20" id="passowrd" name="password"/> <br/> <input type="submit" value="login"/> </form> </body> </html> and thats my login controller. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class login extends CI_Controller { function __construct() { parent::__construct(); } function index() { $this->load->view('login_view'); $this->load->helper(array('form')); } } ?> some help please.. call to undefeined function error - El Forum - 08-11-2013 [eluser]PravinS[/eluser] you need to load validation library $this->load->library('form_validation'); call to undefeined function error - El Forum - 08-14-2013 [eluser]RogerMore[/eluser] And if you're using functions from the form helper in your view, you also should load the form helper BEFORE the $this->load->view(‘login_view’) code. |