I have a registration form where I need to prevent people entering bad usernames. For example, people when they enter their username as virus, then the form should not be accepted. How can I prevent bad usernames in my Registration forms. Is there any function to do the same? Please help. Thanks in advance.
sammry -3 Light Poster
Recommended Answers
Jump to PostHave a database table (or array) with all the banned words - then use preg_match($pattern,$username) or similar, where $pattern could be,e.g.
"/(virus|git|fool)/i"
If you have an array of banned words:
$banned = array('virus','god','blast'...); $pattern = "/(" . implode("|",$banned) . ")/i";
think it'll work - …
Jump to PostYep it's almost impossible :( ie -> v*rus or vir_us will not be detected on the solutions you have here (although they are correct)
I really all depends on what kind of spam we are talking about.. if it is a boot
…
I strongly recommend wcaptha
http://wcaptcha.wozia.pt/sample.php
Jump to Postardav :)
I agree with you.. but I think that that filter will also stop words like funcky :DI think the best solution to this problem.. is your solution, but it's not bullet prove :)
That is why I recommend looking at it from a different angle ;)
All 12 Replies
reco21 4 Light Poster
sammry -3 Light Poster
super9876 0 Newbie Poster

diafol
sammry -3 Light Poster

diafol
migcosta 13 Junior Poster

diafol
migcosta 13 Junior Poster

diafol
sammry -3 Light Poster

diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.