<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to build a spam-free contact form without captchas</title>
	<atom:link href="http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/feed/" rel="self" type="application/rss+xml" />
	<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/</link>
	<description>Expert Advice on Website Development, Javascript, Ajax, and Security</description>
	<lastBuildDate>Thu, 22 Jul 2010 16:58:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Alicia</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-2156</link>
		<dc:creator>Alicia</dc:creator>
		<pubDate>Wed, 10 Mar 2010 01:56:51 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-2156</guid>
		<description>Yes, checking for extra fields injection is mandatory.

One migh also want the Name to be added there too ( not just the email ), and the subject of the email can be something like &#039;Contact Form &#039; . $POST[subject] ..

I use formchamp.com to build and generate forms that send emails, and they also have a captcha less version that uses a hidden field to catch spam. Just as per suggestion of this blog entry</description>
		<content:encoded><![CDATA[<p>Yes, checking for extra fields injection is mandatory.</p>
<p>One migh also want the Name to be added there too ( not just the email ), and the subject of the email can be something like &#8216;Contact Form &#8216; . $POST[subject] ..</p>
<p>I use formchamp.com to build and generate forms that send emails, and they also have a captcha less version that uses a hidden field to catch spam. Just as per suggestion of this blog entry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nFriedly</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-2113</link>
		<dc:creator>nFriedly</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:12:08 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-2113</guid>
		<description>Hi Naz, you can do that by changing the line

[php]
mail( &#039;you@yoursite.com&#039;, &#039;Contact Form&#039;, print_r($_POST,true) );
[/php]

to this:

[php]
$youremail = &#039;you@yoursite.com&#039;;

$body = &quot;This is the form that was just submitted:
Name:  $_POST[name]
E-Mail: $_POST[email]
Message: $_POST[message]&quot;;

if( $_POST[&#039;email&#039;] &amp;&amp; !preg_match( &quot;/[\r\n]/&quot;, $_POST[&#039;email&#039;]) ) {
  $headers = &quot;From: $_POST[email]&quot;;
} else {
  $headers = &quot;From: $youremail&quot;;
}

mail($youremail, &#039;Contact Form&#039;, $body, $headers );
[/php]

The preg_match() is there to make sure spammers can&#039;t abuse your server by injecting extra fields (such as CC and BCC) into the header. Take a look at http://www.thesitewizard.com/php/protect-script-from-email-injection.shtml for more info.</description>
		<content:encoded><![CDATA[<p>Hi Naz, you can do that by changing the line</p>
<pre class="brush: php;">
mail( 'you@yoursite.com', 'Contact Form', print_r($_POST,true) );
</pre>
<p>to this:</p>
<pre class="brush: php;">
$youremail = 'you@yoursite.com';

$body = &quot;This is the form that was just submitted:
Name:  $_POST[name]
E-Mail: $_POST[email]
Message: $_POST[message]&quot;;

if( $_POST['email'] &amp;&amp; !preg_match( &quot;/[\r\n]/&quot;, $_POST['email']) ) {
  $headers = &quot;From: $_POST[email]&quot;;
} else {
  $headers = &quot;From: $youremail&quot;;
}

mail($youremail, 'Contact Form', $body, $headers );
</pre>
<p>The preg_match() is there to make sure spammers can&#8217;t abuse your server by injecting extra fields (such as CC and BCC) into the header. Take a look at <a href="http://www.thesitewizard.com/php/protect-script-from-email-injection.shtml" rel="nofollow">http://www.thesitewizard.com/php/protect-script-from-email-injection.shtml</a> for more info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naz</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-2109</link>
		<dc:creator>Naz</dc:creator>
		<pubDate>Sun, 28 Feb 2010 10:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-2109</guid>
		<description>Hey, I tried this code and it works fine. But when I get the email. It comes with Array{} codes and even it shows the submit. Is there a way I can make it much better? Also it comes from my mail server which is an ugly address lol.</description>
		<content:encoded><![CDATA[<p>Hey, I tried this code and it works fine. But when I get the email. It comes with Array{} codes and even it shows the submit. Is there a way I can make it much better? Also it comes from my mail server which is an ugly address lol.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-93</link>
		<dc:creator>William</dc:creator>
		<pubDate>Sat, 11 Jul 2009 00:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-93</guid>
		<description>The method that you described does sound very interesting. However, recently I started using Mollom ( http://mollom.com ). There is no captcha. The form is processed by their bot and if it appears to be spam, it is rejected. I was getting at least one spam message in my inbox everyday even with a captcha. I started using Mollom about a month ago and so far only 1 spam message has gotten through.
I do want to look at the method that you described above though. I definitely see some benefits with it.</description>
		<content:encoded><![CDATA[<p>The method that you described does sound very interesting. However, recently I started using Mollom ( <a href="http://mollom.com" rel="nofollow">http://mollom.com</a> ). There is no captcha. The form is processed by their bot and if it appears to be spam, it is rejected. I was getting at least one spam message in my inbox everyday even with a captcha. I started using Mollom about a month ago and so far only 1 spam message has gotten through.<br />
I do want to look at the method that you described above though. I definitely see some benefits with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nFriedly</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-50</link>
		<dc:creator>nFriedly</dc:creator>
		<pubDate>Thu, 18 Jun 2009 14:17:16 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-50</guid>
		<description>Oh yea, I love jQuery, if you take a look at the live demo linked in the article, http://nfriedly.com/contact , you&#039;ll see that it uses jquery to go a little above and beyond what I mention here.</description>
		<content:encoded><![CDATA[<p>Oh yea, I love jQuery, if you take a look at the live demo linked in the article, <a href="http://nfriedly.com/contact" rel="nofollow">http://nfriedly.com/contact</a> , you&#8217;ll see that it uses jquery to go a little above and beyond what I mention here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan M.</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-49</link>
		<dc:creator>Ryan M.</dc:creator>
		<pubDate>Thu, 18 Jun 2009 13:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-49</guid>
		<description>Not sure if you have taken a look at JQuery. At this point in time I&#039;m sure you have. When i first saw i ran as fast as i code. The big chunks of code were over whelming. Besides all that, Jqery has a write in code snippet that can be used to plug chunks of code anywhere on the page based on criteria. This link ( http://docs.jquery.com/Manipulation ) has the code calls to manipulate code on a page. Very helpful if added on to your tut to provide reusable code and added security to perhaps dynamically create the whole form.</description>
		<content:encoded><![CDATA[<p>Not sure if you have taken a look at JQuery. At this point in time I&#8217;m sure you have. When i first saw i ran as fast as i code. The big chunks of code were over whelming. Besides all that, Jqery has a write in code snippet that can be used to plug chunks of code anywhere on the page based on criteria. This link ( <a href="http://docs.jquery.com/Manipulation" rel="nofollow">http://docs.jquery.com/Manipulation</a> ) has the code calls to manipulate code on a page. Very helpful if added on to your tut to provide reusable code and added security to perhaps dynamically create the whole form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nFriedly</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-30</link>
		<dc:creator>nFriedly</dc:creator>
		<pubDate>Tue, 09 Jun 2009 15:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-30</guid>
		<description>Oh, certainly, this is just a basic line of defense. The smart ones will still get you, but let&#039;s face it: most spammers aren&#039;t that smart or they&#039;d be in a different line of work.</description>
		<content:encoded><![CDATA[<p>Oh, certainly, this is just a basic line of defense. The smart ones will still get you, but let&#8217;s face it: most spammers aren&#8217;t that smart or they&#8217;d be in a different line of work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Lynch</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-29</link>
		<dc:creator>Richard Lynch</dc:creator>
		<pubDate>Tue, 09 Jun 2009 15:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-29</guid>
		<description>The anti-spam extra field is good.

The Javascript to &quot;hide&quot; your email is only going to be partially successful.

SpiderMonkey will cheerfully run the JS for the slightly smart spammers who run that to gather more/better emails.

So you&#039;ve only stopped the stupidest spammers, not the slightly smart one.s</description>
		<content:encoded><![CDATA[<p>The anti-spam extra field is good.</p>
<p>The Javascript to &#8220;hide&#8221; your email is only going to be partially successful.</p>
<p>SpiderMonkey will cheerfully run the JS for the slightly smart spammers who run that to gather more/better emails.</p>
<p>So you&#8217;ve only stopped the stupidest spammers, not the slightly smart one.s</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nFriedly</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-28</link>
		<dc:creator>nFriedly</dc:creator>
		<pubDate>Tue, 09 Jun 2009 03:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-28</guid>
		<description>Thanks Ivan, post a link here when you do! BTW, I love the look of your site.</description>
		<content:encoded><![CDATA[<p>Thanks Ivan, post a link here when you do! BTW, I love the look of your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Bayross</title>
		<link>http://nfriedly.com/techblog/2009/06/how-to-build-a-spam-free-contact-forms-without-captchas/comment-page-1/#comment-27</link>
		<dc:creator>Ivan Bayross</dc:creator>
		<pubDate>Tue, 09 Jun 2009 03:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://nfriedly.com/techblog/?p=23#comment-27</guid>
		<description>Thank you for a really simple explanation and codespec.  

In its simplicity its brilliant and effective.  I&#039;m going to implement this approach with the few web forms I use.   

Ivan Bayross</description>
		<content:encoded><![CDATA[<p>Thank you for a really simple explanation and codespec.  </p>
<p>In its simplicity its brilliant and effective.  I&#8217;m going to implement this approach with the few web forms I use.   </p>
<p>Ivan Bayross</p>
]]></content:encoded>
	</item>
</channel>
</rss>
