<?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>XprsYrslf &#187; Coding &#38; Web Design &#187; WordPress</title>
	<atom:link href="http://xprsyrslf.be/category/web-technology/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://xprsyrslf.be</link>
	<description>by Jeroen Op &#039;t Eynde</description>
	<lastBuildDate>Fri, 09 Apr 2010 03:42:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Contactform Plugin for WordPress</title>
		<link>http://xprsyrslf.be/2009/08/22/contactform-plugin-for-wordpress/</link>
		<comments>http://xprsyrslf.be/2009/08/22/contactform-plugin-for-wordpress/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 19:31:06 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://xprsyrslf.be/?p=423</guid>
		<description><![CDATA[I've worked on a plugin for WordPress, actually I have been rewriting the Contact Form Captcha plugin. I've tackled out the javascript bit for generating the captcha and added a few features to the email itself.]]></description>
			<content:encoded><![CDATA[<p><a href="http://xprsyrslf.be/wordpress/wp-content/uploads/2009/08/secure_email.png"><img class="alignright size-thumbnail wp-image-448" title="Secure Email" src="http://xprsyrslf.be/wordpress/wp-content/uploads/2009/08/secure_email-150x150.png" alt="Secure Email" width="150" height="150" /></a> I&#8217;ve worked on a plugin for WordPress, actually I have been rewriting the <a href="http://eazeenet.in/contact-form-with-captcha-plugin-for-wordpress/">Contact Form Captcha</a> plugin (also <a href="http://wordpress.org/extend/plugins/contact-form-captcha/">here</a> on WP Extend). I&#8217;ve tackled out the javascript bit for generating the captcha and added a few features to the email itself.</p>
<p>You can download it from <a href="http://xprsyrslf.be/wordpress/wp-content/uploads/2009/08/contactform.1.0.tar.gz">here</a>.</p>
<p>The code generated in the captcha will only contain alphabetic capitals between A &amp; Z, which is stronger, I&#8217;m not a security expert but 26<sup>6</sup> is a higher number than 10<sup>6</sup>. Instead of the javascript validation, it only uses server side validation. The boxes will get a red border to indicate if there was something wrong in there. This indication can be easily expanded in the source, maybe I&#8217;ll add that later. The code comparison will happen in a session, so no client side hacking possible.</p>
<p>Next big thing I did was the email validation check with regular expressions, I&#8217;ll talk more about that later. This validation should be foolproof and even checks if the domain has <a onclick="this.target='_blank'" href="http://en.wikipedia.org/wiki/MX_record">MX records</a>. Check out the function, it should be reusable in any project using PHP 4 or newer, please include credits. Code released under <a onclick="this.target='_blank'" href="http://creativecommons.org/licenses/by-sa/2.0/be/">Creative Commons Attribution-Share Alike 2.0 Belgium License</a></p>
<pre>function check_email($email) {
	//Function written by Jeroen Op 't Eynde - XprsYrslf.be
	//Creative Commons Attribution-Share Alike 2.0 Belgium License
	//Pattern from: http://fightingforalostcause.net/misc/2006/compare-email-regex.php
	$pattern = "/^[-a-z0-9~!$%^&amp;*_=+}{\'?]+(\.[-a-z0-9~!$%^&amp;*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|asia|cat|jobs|tel|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i";
	if (function_exists('checkdnsrr')){
		list($user,$domain) = split('@',$email);
		if(preg_match($pattern,$email) &amp;&amp; checkdnsrr($domain,"MX")) return $email; //Linux: PHP 4.3.0 &amp; Windows: PHP 5.3.0
		else return false;
	} else {
		if(preg_match($pattern,$email)) return $email; //PHP 4 or 5
		else return false;
	}
}</pre>
<p>I thank <a href="http://blog.tuxz.net/archives/2009/03/27/email_validation_using_regular_expression/">Alexandre De Dommelin</a> &amp; <a href="http://fightingforalostcause.net/misc/2006/compare-email-regex.php">Ian Dunn</a> for the regex research.</p>
<p>As I said, I&#8217;ve added a few features to the email that makes it more usable for different website&#8217;s. List of features:</p>
<ul>
<li>Date of Submission</li>
<li>Server&#8217;s Name (or Website&#8217;s Name)</li>
<li>IP address of person using the form</li>
<li>URL of page containing the form</li>
</ul>
<p>Like in the original plugin by Eazeenet, you can add &lt;!&#8211;contact form&#8211;&gt; anywhere you want to put it. But now it puts it exactly where you put the tag and not only below the text of that page.</p>
<p>That&#8217;s it. You can see an example of the contact form <a href="http://xprsyrslf.be/contact/">here</a>. You are free to test it with any hate mail you want. Any bugs and/or features can be reported as a reply to this post or via the contact form, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://xprsyrslf.be/2009/08/22/contactform-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XHTML to HTML plugin for WordPress</title>
		<link>http://xprsyrslf.be/2009/08/20/xhtml-to-html-plugin-for-wordpress/</link>
		<comments>http://xprsyrslf.be/2009/08/20/xhtml-to-html-plugin-for-wordpress/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 22:50:03 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://xprsyrslf.be/?p=404</guid>
		<description><![CDATA[In setting up WordPress for the use of this website, I noticed it was fully written in XHTML, while some browsers don't support the 'application/XHTML+XML' MIME type, so they get it served as 'text/html'.  So, before I get too technical, I just wanted to display the website as HTML (4.01 Strict).]]></description>
			<content:encoded><![CDATA[<p>In setting up WordPress for the use of this website, I noticed it was fully written in XHTML, while some browsers don&#8217;t support the &#8216;application/XHTML+XML&#8217; MIME type, so they get it served as &#8216;text/html&#8217;.  So, before I get too technical, I just wanted to display the website as HTML (4.01 Strict).</p>
<p>Fortunately, there was a simple plugin that solved this quickly:  <a onclick="this.target='_blank'" href="http://www.kilroyjames.co.uk/2008/07/xhtml-to-html-wordpress-plugin/">XHTML to XML plugin</a>. You can find more about the above issues on that page. For use in this website, I added 2 lines of my own, to turn onclick=&#8221;this.target=&#8217;something&#8217;&#8221;  in  onclick=&#8221;this.target=&#8217;something&#8217;&#8221;.</p>
<pre>
&lt;?php
  ...
  $xhtml[5] = '/target="([_A-Za-z]+)"/';
  ...
  $html[5] = 'onclick="this.target=\'$1\'"';
  ...
?&gt;
</pre>
<p>Thanks and <a href="http://xprsyrslf.be/about/#Accreditation">credits</a> go to John Kilroy.</p>
]]></content:encoded>
			<wfw:commentRss>http://xprsyrslf.be/2009/08/20/xhtml-to-html-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
