Any body can tell me how i can add user validation .....to my website I mean length , character using regular expression
For example to validate the username which length has to be 2-64 characters and allowable characters are a-z, 0-9 and _ use this script: <?php if(preg_match("/^[a-z0-9_]{2,64}$/i",$user)){ echo("Valid user"); }else{ echo("Invalid user"); } ?> PHP: