![]() |
Issu form_validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Issu form_validation (/showthread.php?tid=1355) |
Issu form_validation - komang suryadana - 03-02-2015 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 RE: Issu form_validation - _this - 03-02-2015 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 ![]() RE: Issu form_validation - CroNiX - 03-02-2015 Or (also in the userguide) use an array... $this->load->library(array('session', 'form_validation')); RE: Issu form_validation - komang suryadana - 03-02-2015 ok i am try Tanks all RE: Issu form_validation - komang suryadana - 03-03-2015 How to view specific error in form? RE: Issu form_validation - Avenirer - 03-03-2015 It would be a good idea to rtfm... http://www.codeigniter.com/docs RE: Issu form_validation - _this - 03-03-2015 @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 ! RE: Issu form_validation - sandeep - 03-03-2015 Hi Komang, You can Load session library in autoload.php as well. As you have to use session in maximum pages. RE: Issu form_validation - komang suryadana - 03-04-2015 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; ![]() RE: Issu form_validation - CroNiX - 03-04-2015 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. |