Issu form_validation |
PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Error message : A PHP Error was encountered Severity: Notice Message: Undefined property: Login::$form_validation Filename: admin/login.php Line Number: 19 Backtrace: File: C:\xampp\htdocs\cms\application\controllers\admin\login.php Line: 19 Function: _error_handler File: C:\xampp\htdocs\cms\index.php Line: 292 Function: require_once
Hello komang,
According to CI3 User Guide, look at Loader Class and you'll see that you can't pass two libraries as two string parameters. The class will try here to load the session class with a form_validation parameter, which is interpreted as a var that doesn't exist at all. The good way is to chain load : PHP Code: $this->load->library('session') Or even the same array method that you used to load helpers in constructor
Or (also in the userguide) use an array...
$this->load->library(array('session', 'form_validation'));
It would be a good idea to rtfm... http://www.codeigniter.com/docs
Website: http://avenir.ro
@Avenirer : Agree with you, but it would be great to redirect him to the right page of userguide ^^
@komang: Here are form validation error handling You should add the UserGuide to your bookmarks !
Hi Komang,
You can Load session library in autoload.php as well. As you have to use session in maximum pages.
Help me to use xss_clean in form_validation?
i am trying still an error as below. Unable to access an error message corresponding to your field name Username. Unable to access an error message corresponding to your field name Password. this my code to use xss_clean: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); and i set PHP Code: $config['global_xss_filtering'] = TRUE;
03-04-2015, 05:45 PM
(This post was last modified: 03-04-2015, 05:47 PM by CroNiX. Edit Reason: add link to userguide )
You'd also need to show us the view where you are trying to display the error messages. You also don't use xss_clean for a validation rule. More recent versions of CI removed that. See the available rules in the CI3 userguide.
|
Welcome Guest, Not a member yet? Register Sign In |