• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression test or form validation for login

#2
[eluser]whobutsb[/eluser]
[quote author="quibstar" date="1262898363"]I'm trying to have my login require at least one number, special character. But I don't see any way to use regular expression or form validation to accomplish this.[/quote]

I'm not a RegExp whiz but you can check out this tutorial for more info on Regular expressions.


As for the validation you can use callbacks

Code:
function myfunction(){

    $this->load->library('form_validation');

    $this->form_validation->set_rules('username', 'Username', 'callback_username_check');
    
    if(!$this->form_validation->run()){
        //Failed
        return;
    }
    
    //Success
    
}


function username_check($username){
    
    //Run your regexp function here
    
    //Return TRUE or FALSE
    
}


Messages In This Thread
Regular Expression test or form validation for login - by El Forum - 01-07-2010, 09:06 AM
Regular Expression test or form validation for login - by El Forum - 01-07-2010, 09:14 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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