![]() |
Form and form validation - Can't get it to work - 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: Form and form validation - Can't get it to work (/showthread.php?tid=52900) |
Form and form validation - Can't get it to work - El Forum - 07-01-2012 [eluser]vYN[/eluser] Hi. I'am new to codeingiter and php and so on. And i got a problem that i can't fix.. So. here is the code: function: Code: function register() in the user_model: Code: function registeruser($REGusername, $REGemail, $REGpassword) When i try to fail the registration. it does not give me any errors on the page... and i have "<?php echo validation_errors(); ?>" on the page. And i got an another form also. And it is the same with that. I'm not sure if it is some other code. Because the other one is supposed to send a mail. It simply does not work/do anything when i hit the submit button.... and here is my website registration: http://stiantofte.net/user/register EDIT: I think there is something wrong with my form_validation... Because it seems it can't pass it anyway. or give errors and so on. Form and form validation - Can't get it to work - El Forum - 07-01-2012 [eluser]skunkbad[/eluser] Please show view code, specifically the form. Form and form validation - Can't get it to work - El Forum - 07-01-2012 [eluser]vYN[/eluser] Here it is: Code: <h1>Register!</h1><hr /> Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]Nisha S.[/eluser] Remove the callback validation method callback__check_username and try. There might be an error with that function. Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]InsiteFX[/eluser] This is wrong: Code: if ($this->form_validation->run() === FALSE) Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]vYN[/eluser] [quote author="InsiteFX" date="1341310711"]This is wrong: Code: if ($this->form_validation->run() === FALSE) ye i know. i have already fixed that. But still it does not work... and i removed "callback__check_username" but that did also not work.. Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]Nisha S.[/eluser] @vYN "if ($this->form_validation->run() === FALSE)" is correct. Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]vYN[/eluser] [quote author="Nisha S." date="1341337282"]@vYN "if ($this->form_validation->run() === FALSE)" is correct.[/quote] well ok. But it still does not work... Form and form validation - Can't get it to work - El Forum - 07-03-2012 [eluser]vYN[/eluser] i think there is a problem with the form. like it has problems opening the form or something. I'm not sure... Form and form validation - Can't get it to work - El Forum - 07-04-2012 [eluser]cartalot[/eluser] ok here you call the model in the controller Code: $this->user_model->registeruser(); and here is the code in the model Code: function registeruser($REGusername, $REGemail, $REGpassword) so first -- you need to take the values from the form, and pass them to registeruser. theres different ways to do this but take a look at the tutorial in the user guide for some first examples. and then in the model, for registeruser - put in an error check, and for example return the id if true, and return false if the record did not insert in model, in registeruser() Code: // if record inserted, kick back the ID, else false in controller Code: // IF registeruser did not create record |