codigniter check username and email availability problem - 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: codigniter check username and email availability problem (/showthread.php?tid=53950) |
codigniter check username and email availability problem - El Forum - 08-15-2012 [eluser]shivi[/eluser] hello all . my problem is when i check if username or email already exits . but when i try to register with same username and email it always show me the message . The Username field must contain a unique value. The Email field must contain a unique value. why do not show me the message that i want to show in callback function . where is my mistake thanks very much here is form set_rules Code: public function registration_validation(){ here is my model code where is check if username and email exits or not Code: public function checkUsernameAvailability(){ and in my main controller i do all this Code: public function check_Username(){ codigniter check username and email availability problem - El Forum - 08-15-2012 [eluser]CroNiX[/eluser] Because you are using the is_unique rule before your callback, and that error message is from that rule. codigniter check username and email availability problem - El Forum - 08-15-2012 [eluser]DarkManX[/eluser] Hi, you probably didnt get it right. Just study the manuels again and try some stuff. You have done some nerd coding i dont understand. All you need is: Code: $this->load->library('form_validation'); codigniter check username and email availability problem - El Forum - 08-15-2012 [eluser]shivi[/eluser] noooo i found my mistake i delete is_unique and i also resolved with my callback function thanks very much codigniter check username and email availability problem - El Forum - 08-15-2012 [eluser]DarkManX[/eluser] Your own callback functions do the same as is_unique. No need for redundancy codigniter check username and email availability problem - El Forum - 08-16-2012 [eluser]shivi[/eluser] yess i know very well my callback function do the same as is_unique . but i prefer use my callback function. there is no question for redundancy okkk thanks codigniter check username and email availability problem - El Forum - 08-16-2012 [eluser]M Arfan[/eluser] Code: $this->form_validation->set_message('check_Username','Username already exist please choose onther one'); try this |