Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Arshdeep Singh
PLUS
Arshdeep Singh
Courses Plus Student 8,349 Points

Any tutorials on how to make spam free php contact form?

My previous webste use to get alot of span through conatct form. I want to make a form that is spam free, if you know any tutrials or videos. please let me know. thanks

2 Answers

Did you go through the simple application course? http://teamtreehouse.com/library/build-a-simple-php-application Specifically shows you to build a contact form. From memory I think it's specifically mentioned to add a hidden field as a simple way to prevent spam.

Lorenzo Pieri
Lorenzo Pieri
19,772 Points

Indeed, the instructor added a fake "Address" field and a guard at the top of the page. Something like:

<?php
if(isset($_POST("address")) :

   die();
endif
?>
Arshdeep Singh
PLUS
Arshdeep Singh
Courses Plus Student 8,349 Points

Thank you guys, one thing that i just noticed, that the tutor never tells where to put the email address to which the emails from the contact form will be sent.