Validation headaches - 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: Validation headaches (/showthread.php?tid=2586) |
Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] Hello, I bet I'm not the first to have this kind of trouble as a noob, but I'm puzzled about how to do validation properly using the validation class. I've searched the docs and forum, but it still isn't exactly clear to me. Hope you guys can help! Basically I want a user to change his password. Therefore he has to enter the old pass, the new and a new retype. Pretty basic stuff (in plain old php I can do it with no probs). The input of the old password is checked against the DB. Now, if the password doesn't exist, aan error should be thrown. But I can't seem to get the validation working. This is what I have so far: Controller: settings.php Code: <?php Model: settings_model.php Code: <?php View: password_view.php Code: <?=$this->validation->error_string; ?> Any help is greatly appreciated!! Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] Or the 'callback' function is what I'm looking for... Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] But still, this doesn't work for me. Am I missing something? Code: function password() Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] Ok, got it. The function needed was embedded in another function, which is incorrect I guess. Validation headaches - El Forum - 08-13-2007 [eluser]NemetraL[/eluser] Hello, 1) what makes you think that the validation is not working (ie what is displayed? we need to know more..) 2) is 'bogus' really in your database as a password? My 2 cents.. Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] Hey Nemetral, Thanks, but I already got it. And no, bogus is just a, well, bogus password. Validation headaches - El Forum - 08-13-2007 [eluser]Derek Allard[/eluser] Glad you got it codex. Welcome to CI! Validation headaches - El Forum - 08-13-2007 [eluser]codex[/eluser] [quote author="Derek Allard" date="1187068554"]Glad you got it codex. Welcome to CI![/quote] Hey Derek, thanks!! |