<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rob Spencer &#187; security</title>
	<atom:link href="http://robspencer.net/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://robspencer.net</link>
	<description>Programming and Web Development</description>
	<lastBuildDate>Thu, 06 Aug 2009 02:05:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Quick and Easy Way to Keep Bots Off Your Forms</title>
		<link>http://robspencer.net/quick-and-easy-way-to-keep-bots-off-your-forms/</link>
		<comments>http://robspencer.net/quick-and-easy-way-to-keep-bots-off-your-forms/#comments</comments>
		<pubDate>Sat, 02 May 2009 05:31:23 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bots]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://robspencer.net/?p=7</guid>
		<description><![CDATA[A lot of people ask me how to keep bots from spamming their contact forms. Here is a simple way to do it without implementing a captcha code or other complicated security measures. Most bots will fill in form fields they recognize with the data they are spamming. When they come across an unknown field, [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people ask me how to keep bots from spamming their contact forms. Here is a simple way to do it without implementing a captcha code or other complicated security measures.</p>
<p>Most bots will fill in form fields they recognize with the data they are spamming. When they come across an unknown field, they will usually fill it in with a random string just so the form is submitted without error. This is where we can take advantage. <span id="more-7"></span></p>
<p>Create an input field in your form.</p>
<p><code>&lt;input type="text" name="botcatcher" id="botcatcher" /&gt;</code></p>
<p>Then in your css you wanna hide this field.</p>
<p><code>#botcatcher { display:none; }</code></p>
<p>When the form is submitted, you want to check if this field has a value. If it does, discard the form as it&#8217;s usually a bot. I just send them to the thanks page so it appears to be successful. If it doesn&#8217;t have a value then its usually a real user.</p>
<pre name="code" class="php">
&lt;?php
if(empty($_POST['botcatcher'])) {
    //Valid user, Process the form
} else {
    //Invalid user. Discard the form
}
?&gt;
</pre>
<p>I have been using this little technique on my forms for a few years now and it has drastically cut down on spam bots. Try it out and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://robspencer.net/quick-and-easy-way-to-keep-bots-off-your-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

