View Single Post
  #2  
Old 02-18-2016, 11:35 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 116,706
Abronsyth is on a distinguished road
Default

OK, so there's this chunk of code;
Code:
      if($username == "SYSTEM"){
         $this->seterror("Cannot use SYSTEM as username.");
         return FALSE;
      }
But I'm wondering if I could do something like this to make it so the only characters that can be entered are alphanumeric and spaces? So if a user tries something like; "user_name" then they'll get the error; "Sorry, you cannot use special characters in your username."

Some folks use this sort of code;
PHP Code:
if(preg_match('/^[a-zA-Z0-9 ]+$/'$username)) {

Do y'all think I'd be able to incorporate that somehow..?
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 02-18-2016 at 11:44 AM.
Reply With Quote