![]() |
help with login - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: help with login (/showthread.php?tid=26227) |
help with login - El Forum - 01-08-2010 [eluser]dadamssg[/eluser] So im trying to validate a simple login form. I'm trying to check if the username and password were found in my database. I don't know how to grab the cleaned password into my username_check function though. How do i assign that? my controller Code: <?php Code: <?php help with login - El Forum - 01-08-2010 [eluser]Sean Gates[/eluser] Unfortunately you only get the field value, in your case the username, passed with the callback when using validation. From the docs: Quote:Note: You can also use any native PHP functions that permit one parameter. Therefore, you can only have one parameter, not two. You'll need to move the query logic into the index() function and check for the username/password credentials within the validation success block. help with login - El Forum - 02-14-2010 [eluser]Nakp[/eluser] this is not true at all... you can pass another value using the [] just like "matches[field]" its just that I can't find out how you use the field name and not a string, just like matches does help with login - El Forum - 02-14-2010 [eluser]Nakp[/eluser] actually I did hehehehe Code: function v ($field1, $field2){ so you can use it in your validation rules like 'callback_v[pass]' so you can match the user with that pass ![]() |