Thread: Name too long
View Single Post
  #7  
Old 01-13-2004, 05:18 PM
farce
Hill Giant
 
Join Date: Feb 2003
Posts: 126
Default

PHP code to check if a string has something other than word characters (0-9a-Z_)

Code:
if(preg_match("/\W/", $string) {
   error("Invalid characters in name, please use only a-Z 0-9 and _");
}
error() being pseudo code of course... could forward to invalid_name.php or something to spit that out..


farce
Reply With Quote