Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.