Help - Search - Members - Calendar
Full Version: Php Spam Prevention
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
L. Kaiserblazer
Well, I wrote a fully-functional PHP mail script, and it works just fine. I am looking for ways to prevent Spam to my E-Mail. I know of CAPTCHA, but were looking for some others. Anyone know of any?

If not, I would be needing help disabling a word in my form. Seeing as every Spam e-mail I receive has a HTTP://website in its body, I was hoping to disable the word HTTP, so that when the spam script submits a message with HTTP in it, it will terminate the message and not send it through to my E-Mail.

Any help writing this or guiding me to write it would be greatly appreciated. Thank you!

-Lucas
swordz
It's easy to do.

if(strpos($message, "http") !== FALSE) die();

at any point after you've defined $message and before the mail() line.

There are more graceful ways of handling this, but that should give you the basic idea!

swordz
L. Kaiserblazer
Hey thanks swordz! Will try right away, and post updates. biggrin.gif

EDIT: Seems to be working great swordz!
bbriniotis
captcha is usually the best way to prevent spammers. If you want to detect the spam you can also use bayesian filters. here is a class that does this:
http://www.phpclasses.org/browse/package/4236.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.