<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Email Header Injection in PHP</title>
	<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/</link>
	<description>Web Development Blog</description>
	<pubDate>Fri, 05 Sep 2008 21:55:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Create a Contact Page Part II</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-33946</link>
		<pubDate>Sun, 31 Aug 2008 15:00:57 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-33946</guid>
					<description>[...] There are 3 functions we can use to validate the email address. These functions were originally written by Khalid Hanif and there is also more info on his blog post concerning these. The functions are [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] There are 3 functions we can use to validate the email address. These functions were originally written by Khalid Hanif and there is also more info on his blog post concerning these. The functions are [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Create a Contact Page Part I</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-33549</link>
		<pubDate>Sun, 24 Aug 2008 15:02:23 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-33549</guid>
					<description>[...] Once you&amp;#8217;ve got an established blog you&amp;#8217;ll most likely want a contact page with a contact form on it. Whilst there are a few plugins that do this for you, I tend to find that they either bloat your pages with additional CSS code in the header (CSS code should always be put in an external stylesheet whenever possible), badly written form markup, or probably the worst culprit, the PHP code doesn&amp;#8217;t validate the information in the form to help prevent spam or email header injection. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Once you&#039;ve got an established blog you&#039;ll most likely want a contact page with a contact form on it. Whilst there are a few plugins that do this for you, I tend to find that they either bloat your pages with additional CSS code in the header (CSS code should always be put in an external stylesheet whenever possible), badly written form markup, or probably the worst culprit, the PHP code doesn&#039;t validate the information in the form to help prevent spam or email header injection. [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: George K.</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-31731</link>
		<pubDate>Mon, 14 Jul 2008 10:29:47 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-31731</guid>
					<description>I'm sorry. It's getting dark overhere and I mis-spelled my own name in the email address.
 Once again.
First of all. No-one ever mentions the version of PHP as used. As a beginner on php I understand that there is a lot of difference between PHP4 and PJP5.
Second.
Why - in the example of this article a textarea is used for the From address. Wouldn't it be more safe to use a textfield with a lebgth of e.g. 30 characters?
GHK</description>
		<content:encoded><![CDATA[<p>I&#039;m sorry. It&#039;s getting dark overhere and I mis-spelled my own name in the email address.<br />
 Once again.<br />
First of all. No-one ever mentions the version of PHP as used. As a beginner on php I understand that there is a lot of difference between PHP4 and PJP5.<br />
Second.<br />
Why - in the example of this article a textarea is used for the From address. Wouldn&#039;t it be more safe to use a textfield with a lebgth of e.g. 30 characters?<br />
GHK
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Graham</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-28026</link>
		<pubDate>Fri, 04 Apr 2008 06:41:38 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-28026</guid>
					<description>I have also found it useful to collect the IP address of people who respond using my forms and creating a list of IP addresses that attempt to break the sanitisation, and then:

&lt;code&gt;
  $IP_addr  = $_SERVER['REMOTE_ADDR'];
  $banlist  = fopen(&quot;badIP.txt&quot;, &quot;r&quot;);
  $badips   = &quot;&quot;;
  while ( $data = fgets($banlist) ) {
    $badips .= $data . &quot;;&quot;;
  }
  if ( strstr($badips, $IP_addr) ) die();
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I have also found it useful to collect the IP address of people who respond using my forms and creating a list of IP addresses that attempt to break the sanitisation, and then:</p>
<p><code><br />
  $IP_addr  = $_SERVER['REMOTE_ADDR'];<br />
  $banlist  = fopen("badIP.txt", "r");<br />
  $badips   = "";<br />
  while ( $data = fgets($banlist) ) {<br />
    $badips .= $data . ";";<br />
  }<br />
  if ( strstr($badips, $IP_addr) ) die();<br />
</code>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Sys Admin Nexus &#187; Blog Archive &#187; Email Header Injection in PHP</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-9902</link>
		<pubDate>Mon, 04 Jun 2007 13:12:37 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-9902</guid>
					<description>[...] Taken from jellyandcustard.com [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Taken from jellyandcustard.com [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Brain Goo &#187; Blog Archive &#187; PHP Header injection</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-7459</link>
		<pubDate>Mon, 21 May 2007 17:43:51 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-7459</guid>
					<description>[...] http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/ [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] <a href='http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/' rel='nofollow'>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/</a> [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Bernie Zimmermann</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-7229</link>
		<pubDate>Thu, 17 May 2007 06:36:23 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-7229</guid>
					<description>Thanks for the great article.  I just found out today that spammers have been abusing my contact forms, so this was a great resource.

I tweaked some of the functions a bit so they're a bit more logical, and fixed the regular expression for email validation since the one provided doesn't escape the &quot;dots&quot; correctly.

I've posted a summary of the changes over at &lt;a href=&quot;http://www.bernzilla.com/item.php?id=850&quot; title=&quot;Avoiding Email Header Injection in PHP&quot; rel=&quot;nofollow&quot;&gt;my blog&lt;/a&gt;.

Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks for the great article.  I just found out today that spammers have been abusing my contact forms, so this was a great resource.</p>
<p>I tweaked some of the functions a bit so they&#039;re a bit more logical, and fixed the regular expression for email validation since the one provided doesn&#039;t escape the &#034;dots&#034; correctly.</p>
<p>I&#039;ve posted a summary of the changes over at <a href="http://www.bernzilla.com/item.php?id=850" title="Avoiding Email Header Injection in PHP" rel="nofollow">my blog</a>.</p>
<p>Thanks again!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: schrose</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-4660</link>
		<pubDate>Tue, 10 Apr 2007 01:38:06 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-4660</guid>
					<description>Try this solution.
http://beauford.vox.com/library/post/beaus-php-5-mail-logging-solution-for-windows-server-2003.html</description>
		<content:encoded><![CDATA[<p>Try this solution.<br />
<a href='http://beauford.vox.com/library/post/beaus-php-5-mail-logging-solution-for-windows-server-2003.html' rel='nofollow'>http://beauford.vox.com/library/post/beaus-php-5-mail-logging-solution-for-windows-server-2003.html</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: koolbenny</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-2509</link>
		<pubDate>Wed, 21 Feb 2007 16:33:19 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-2509</guid>
					<description>Thanks everybody, here's my final working script:
http://benclarke.blogspot.com/2007/02/php-email-header-injection-prevention.html</description>
		<content:encoded><![CDATA[<p>Thanks everybody, here&#039;s my final working script:<br />
<a href='http://benclarke.blogspot.com/2007/02/php-email-header-injection-prevention.html' rel='nofollow'>http://benclarke.blogspot.com/2007/02/php-email-header-injection-prevention.html</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Carpenter</title>
		<link>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-1788</link>
		<pubDate>Fri, 26 Jan 2007 19:38:38 +0000</pubDate>
		<guid>http://www.jellyandcustard.com/2006/02/24/email-header-injection-in-php/#comment-1788</guid>
					<description>I think captcha or a math problem as along with $strip_html_tags handles it pretty well for me.</description>
		<content:encoded><![CDATA[<p>I think captcha or a math problem as along with $strip_html_tags handles it pretty well for me.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
