CodeIgniter Forums
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">
&lt;html &gt;
&lt;head&gt;
&lt;title&gt;Simple Login with CodeIgniter&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<h1>Simple Login with CodeIgniter</h1>
&lt;?php echo validation_errors();?&gt;
&lt;?php echo form_open('verifylogin');?&gt;

<label for="username">Username:</label>
&lt;input type="text" size="20" id="username" name="username"/&gt;
<br/>
<label for="password">Password:</label>
&lt;input type="password" size="20" id="passowrd" name="password"/&gt;
<br/>
&lt;input type="submit" value="login"/&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

and thats my login controller.


&lt;?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'));

}

}

?&gt;

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.