<?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: Making a Secure Contact Form with PHP and jQuery</title>
	<atom:link href="http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/</link>
	<description>Windswept Design and Development by Graham Kaemmer</description>
	<lastBuildDate>Sun, 04 Oct 2009 16:00:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: pligg.com</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-19</link>
		<dc:creator>pligg.com</dc:creator>
		<pubDate>Sun, 05 Jul 2009 10:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-19</guid>
		<description>&lt;strong&gt;How to Make a Secure Contact Form with PHP and jQuery...&lt;/strong&gt;

You should always give your users the opportunity to contact the webmaster, when you are building a website. One way to do it is to give out the email address. Unfortunately, putting your email address up on a website makes it a target for the spam bot...</description>
		<content:encoded><![CDATA[<p><strong>How to Make a Secure Contact Form with PHP and jQuery&#8230;</strong></p>
<p>You should always give your users the opportunity to contact the webmaster, when you are building a website. One way to do it is to give out the email address. Unfortunately, putting your email address up on a website makes it a target for the spam bot&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IceGhost</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-18</link>
		<dc:creator>IceGhost</dc:creator>
		<pubDate>Sun, 05 Jul 2009 08:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-18</guid>
		<description>This is the most  unsecure form :&#124;
There is no input sanitizing/filters nothing</description>
		<content:encoded><![CDATA[<p>This is the most  unsecure form <img src='http://www.cyclonicstudios.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /><br />
There is no input sanitizing/filters nothing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Love</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-17</link>
		<dc:creator>Steve Love</dc:creator>
		<pubDate>Sat, 04 Jul 2009 22:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-17</guid>
		<description>Nice post. This is a great start to get people thinking about vulnerabilities in their contact forms.

I realize you probably just intended this as a simple example, but for anyone planning to use this code, it should be noted that it&#039;s still wide open for exploits. The main issue is that the random key is not deleted after use. I can simply sit on the form and click the submit button (or write a script to do it) to send successful messages all day long. Or, if I really wanted to, I could visit the form to grab the hidden key and insert it into my own form to spam contact.php. Unset the session variable after validating it and you&#039;ll get a little extra mileage out of this script.

And just as a side note, while we&#039;re talking about giving users an opportunity to contact you, keep in mind that this example will not work for the users who have JavaScript disabled in their browser. In fact, the way this script is written they&#039;ll get no error message at all.</description>
		<content:encoded><![CDATA[<p>Nice post. This is a great start to get people thinking about vulnerabilities in their contact forms.</p>
<p>I realize you probably just intended this as a simple example, but for anyone planning to use this code, it should be noted that it&#8217;s still wide open for exploits. The main issue is that the random key is not deleted after use. I can simply sit on the form and click the submit button (or write a script to do it) to send successful messages all day long. Or, if I really wanted to, I could visit the form to grab the hidden key and insert it into my own form to spam contact.php. Unset the session variable after validating it and you&#8217;ll get a little extra mileage out of this script.</p>
<p>And just as a side note, while we&#8217;re talking about giving users an opportunity to contact you, keep in mind that this example will not work for the users who have JavaScript disabled in their browser. In fact, the way this script is written they&#8217;ll get no error message at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-16</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sat, 04 Jul 2009 21:39:15 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-16</guid>
		<description>You should check the POST[&#039;contact_key&#039;] with !empty() rather than using isset().

A bot could post an empty contact key and since they didn&#039;t originate for the form, the SESSION[&#039;contact_key&#039;] would also be empty.

That would pass the test above and allow the bot to spam your form.

It&#039;s a minor but important change.</description>
		<content:encoded><![CDATA[<p>You should check the POST['contact_key'] with !empty() rather than using isset().</p>
<p>A bot could post an empty contact key and since they didn&#8217;t originate for the form, the SESSION['contact_key'] would also be empty.</p>
<p>That would pass the test above and allow the bot to spam your form.</p>
<p>It&#8217;s a minor but important change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alfred westerveld</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-15</link>
		<dc:creator>alfred westerveld</dc:creator>
		<pubDate>Sat, 04 Jul 2009 18:08:26 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-15</guid>
		<description>Good tutorial. Have couple tips for javasript jquery. First of all I think it should be wrapped in  $(document).ready(function() {});

Second I would use var contactform = $(&#039;form#contact&#039;); because otherwise global namespace will be polluted.

$(document).ready(function() {
contactform = $(&#039;form#contact&#039;);
contactform.submit(function() {
	$.post(&#039;/contact.php&#039;, $(this).serialize(), function(data) {
		$(&#039;form#contact&#039;).append(&quot;&quot;+data);
	});
	return false;
});
});</description>
		<content:encoded><![CDATA[<p>Good tutorial. Have couple tips for javasript jquery. First of all I think it should be wrapped in  $(document).ready(function() {});</p>
<p>Second I would use var contactform = $(&#8216;form#contact&#8217;); because otherwise global namespace will be polluted.</p>
<p>$(document).ready(function() {<br />
contactform = $(&#8216;form#contact&#8217;);<br />
contactform.submit(function() {<br />
	$.post(&#8216;/contact.php&#8217;, $(this).serialize(), function(data) {<br />
		$(&#8216;form#contact&#8217;).append(&#8220;&#8221;+data);<br />
	});<br />
	return false;<br />
});<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kendall</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-14</link>
		<dc:creator>Kendall</dc:creator>
		<pubDate>Sat, 04 Jul 2009 17:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-14</guid>
		<description>This doesn&#039;t stop many spambots. Most that I&#039;ve seen that visit my site first get the page and can see all the form fields and pick up a session. They then use this session to send a message with all form fields filled out, and they also share the sessions with others so a &quot;valid&quot; sessions gets used multiple times, usually about 4 attempts. What you&#039;ve shown here wouldn&#039;t phase these spambots.

Using a honeypot alone would be more effective. A honeypot being a form field that&#039;s visually hidden (not using the type=&quot;hidden&quot;, but rather CSS) and the PHP script expects to be empty. Spambots will fill it out blindly and thus you&#039;ll know it&#039;s spam. There&#039;s a number of other effective techniques, but the one given in the article does nothing really.</description>
		<content:encoded><![CDATA[<p>This doesn&#8217;t stop many spambots. Most that I&#8217;ve seen that visit my site first get the page and can see all the form fields and pick up a session. They then use this session to send a message with all form fields filled out, and they also share the sessions with others so a &#8220;valid&#8221; sessions gets used multiple times, usually about 4 attempts. What you&#8217;ve shown here wouldn&#8217;t phase these spambots.</p>
<p>Using a honeypot alone would be more effective. A honeypot being a form field that&#8217;s visually hidden (not using the type=&#8221;hidden&#8221;, but rather CSS) and the PHP script expects to be empty. Spambots will fill it out blindly and thus you&#8217;ll know it&#8217;s spam. There&#8217;s a number of other effective techniques, but the one given in the article does nothing really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.cyclonicstudios.com/making-a-secure-contact-form-with-php-and-jquery/comment-page-1/#comment-13</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 02 Jul 2009 16:14:24 +0000</pubDate>
		<guid isPermaLink="false">http://cyclonicstudios.com/?p=104#comment-13</guid>
		<description>FYI...this isn&#039;t secure at all. Your form is still easily hijacked as you do no request var validation/filtering. Your concatenated header strings can be easily spoofed and spam messages CC&#039;d and BCC&#039;d with no sweat. Based on how your PHP code operates, comparing session tokens is pretty worthless and isn&#039;t &quot;protecting&quot; much at all. Any spammer can sit there all day long BCCing spam messages right under your nose.

Web Programming 101: Don&#039;t trust user inputs.</description>
		<content:encoded><![CDATA[<p>FYI&#8230;this isn&#8217;t secure at all. Your form is still easily hijacked as you do no request var validation/filtering. Your concatenated header strings can be easily spoofed and spam messages CC&#8217;d and BCC&#8217;d with no sweat. Based on how your PHP code operates, comparing session tokens is pretty worthless and isn&#8217;t &#8220;protecting&#8221; much at all. Any spammer can sit there all day long BCCing spam messages right under your nose.</p>
<p>Web Programming 101: Don&#8217;t trust user inputs.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

