• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form validation by my own method

#7
@Valery, Not sure how to pass 2 parameters. But if your users->get_access($usr,$pwd) takes two parameters and you don't supply any parameters or supply just one then get_access($usr,$pwd) will not be called. For example this is how I check if the username registered already:

Code:
$username = $this->input->post("txt_username");
$password = $this->input->post("txt_password");

$this->form_validation->set_rules('txt_username', 'Username', 'trim|required|min_length[5]|max_length[18]|is_unique[users.username]|xss_clean');

It will query users table and see if there is $username. So maybe you could add something like this?

Code:
$this->form_validation->set_rules('txt_password', 'Password', 'is_unique[users.password]');

Of course you have to hash it first.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply


Messages In This Thread
Form validation by my own method - by Valery - 04-25-2015, 09:07 AM
RE: Form validation by my own method - by Valery - 04-28-2015, 04:20 AM
RE: Form validation by my own method - by Valery - 04-28-2015, 04:12 AM
RE: Form validation by my own method - by lexxtoronto - 04-28-2015, 10:51 AM
RE: Form validation by my own method - by CroNiX - 04-28-2015, 11:33 AM
RE: Form validation by my own method - by Valery - 04-29-2015, 07:03 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.