Git Product home page Git Product logo

spam-free-php-contact-form's Introduction

Spam-free contact form

This form will prevent the most common forms of automated "contact form spam" by adding a hidden field to the form. If any text is entered into the hidden field, the message is assumed to be spam and thrown out.

It also uses JavaScript to generate your email address as a clickable link after the page has loaded. This prevents scrapers that do not execute javascript from reading your email address.

It includes both a simple version and an advanced (pretty) version, you should only need to put one or the other on your website.

For a detailed explanation of the methods used, see http://nfriedly.com/techblog/2009/11/how-to-build-a-spam-free-contact-forms-without-captchas/

MIT License

The MIT License (MIT)

Copyright (c) 2013 Nathan Friedly - http://nfriedly.com/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

spam-free-php-contact-form's People

Contributors

nfriedly avatar

Stargazers

Anne Thorpe avatar  avatar  avatar james avatar kige avatar  avatar  avatar ᎠᎡ. Ѕϵrgϵ Ѵictor avatar Nicholas avatar Pascal Tbf avatar Alexandre Dias de Souza avatar Łukasz Wróblewski avatar J.Motyl avatar pigwink avatar Saket Tiwari avatar  avatar Marnick avatar DAVID TIM avatar Moayad Alnuwaysir avatar  avatar Bona Rae Villarta avatar Carlo M. Leo avatar Soyeb Patel avatar Trey Brister avatar The Crushinator avatar Lonnie Wibberding avatar Link Porterfield avatar Bradley Hawkins avatar  avatar  avatar  avatar Mark Gavagan avatar  avatar Jacob Byers avatar  avatar Shrimadhav U K avatar  avatar Len Lorentz avatar Mark Philip Dawal avatar Russell Spencer avatar Ben Pearson avatar Bartosz Józwowiak avatar  avatar  avatar Oliver Falk avatar Martin Allien avatar Omar López avatar Daniel avatar Ben Woodman avatar Patrick Multhaup avatar Dan Malarkey avatar John avatar Catherine Azzarello avatar Chris Mounsey avatar Eli Mellen avatar aleksander351 avatar Roberto Salas avatar Diego Ponce avatar Yan avatar Jonathan Cuthbert avatar  avatar Daniel Stegemann avatar Lawrence Taur avatar Chris Campana avatar  avatar Mohamed Thoufeeq avatar Stephen Karl Larroque avatar  avatar Paul Fitzpatrick avatar Chris Holder avatar Joel Chavez avatar Minh Bằng avatar

Watchers

 avatar James Cloos avatar Joel Chavez avatar Skylimit Productions avatar DAVID TIM avatar  avatar

spam-free-php-contact-form's Issues

Umlauts?

Nice work! I like this simple approach for preventing spam-mails!
Unfortunately, Umlauts (ö ä ü ß ...) are not being sent properly.

How can I fix this? e.g. setting the mail to utf-8?

Still relevant in 2017?

This was updated about 4 years ago. Is this method still good to prevent spam, or are the bots too clever these days?

Unfortunately spam now creeps through

I can clarify that the spam bots have found a way around this, and I get spam every week :( it did well a few years a go, but unfortunately, the bots have evolved!

Line breaks from textarea

Here is another thing:

The form sends all fields like it should, except that text area seems to cut all line breaks.
I found some code, that seems to make sure line breaks are being rendered:

nl2br($_POST["message"]);

But how do I combine this with the (advanced) form?

Thanks for your help!

Cheers
Stephan

Link to blog post broken in readme file

Not so much an issue as pointing it out.

Looks like a great thing you have here. The only thing I noticed is I was interested in reading the blog article about the methods used and it no longer exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.