www.mihalism.com Posted December 2, 2006 Share Posted December 2, 2006 I made a function to check if a name contains banned characters. When the function does check for a banned character it always return false. function banned_letters($name){ global $_CONFIG; for($i=0; $i < strlen($name); $i++){ $pos = strrpos($_CONFIG['allowed_letters'],$name{$i}); if ($pos === false){ return true; }else{ return false; } } } Link to comment Share on other sites More sharing options...
reportingsjr Posted December 2, 2006 Share Posted December 2, 2006 Wow, you are trying wayyy too hard! function banned_letters($name){$pattern = "/(\!\@\#\$\%\^\&\*\(\))/is";$regex = ereg($pattern, "", $name);if($regex){ return false;}else{ return true;} That should work, untested though! So you may have to try it. Tell me if it doesnt work. Link to comment Share on other sites More sharing options...
www.mihalism.com Posted December 2, 2006 Author Share Posted December 2, 2006 Thanks anyways but I have made another method and now it works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now