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

#1
[eluser]quibstar[/eluser]
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.

#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
    
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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