<?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>Simon Whatley &#187; PHP</title>
	<atom:link href="http://www.simonwhatley.co.uk/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Secure Your WordPress Installation</title>
		<link>http://www.simonwhatley.co.uk/secure-your-wordpress-installation</link>
		<comments>http://www.simonwhatley.co.uk/secure-your-wordpress-installation#comments</comments>
		<pubDate>Wed, 11 Aug 2010 09:49:30 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[secret key]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=3731</guid>
		<description><![CDATA[Security is often an overlooked aspect of blogging, but a few minutes making sure things are secure can save you hours and hours of 'fixing' if someone decides to mess with your site.]]></description>
			<content:encoded><![CDATA[<p>Security is often an overlooked aspect of blogging, but a few minutes making sure things are secure can save you hours and hours of &#8216;fixing&#8217; if someone decides to mess with your site.</p>
<p>Here are some relatively simple steps that should help &#8216;toughen up&#8217; your WordPress installation:</p>
<h3>Don&#8217;t use the &#8220;admin&#8221; account.</h3>
<p>Either change the username via MySQL</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">UPDATE wp_users SET user_login = 'username' WHERE user_login = 'admin'</pre></div></div>

<p>*where &#8220;username&#8221; is whatever you want to call it.</p>
<p>Or, create a new/unique account with administrator privileges and delete the original admin account.</p>
<p>From WordPress 3.0 you can set the administrator username and password during the installation process, which is a good step forward.</p>
<h3>Use secure passwords.</h3>
<p>Use strong passwords to protect your website from dictionary attacks. WordPress will tell you when your password is strong (the admin interface for users has a password strength indicator).</p>
<p><a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2010/08/password-strength.png"><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2010/08/password-strength.png" alt="" title="WordPress Password Strength Meter" width="618" height="52" class="aligncenter size-full wp-image-3758" /></a></p>
<p>Don&#8217;t restrict your strong passwords to the WordPress installation, do the same for <abbr title="File Transfer Protocol">FTP</abbr>, <abbr title="Secure Shell">SSH</abbr> and MySQL as well.</p>
<h3>Update the folder permissions on your WordPress files.</h3>
<p>A good rule of thumb is to set the following permissions:</p>
<p>Files should be set to 644<br />
Folders should be set to 755</p>
<p>If these settings are too restrictive, i.e. you can&#8217;t upload files, change the permissions to increase the privileges (e.g. 775 or even 777).</p>
<p>Remember, permission levels vary depending on your specific server configuration, but you can generally set them to the desired level quite easily via <abbr title="File Transfer Protocol">FTP</abbr> or <abbr title="Secure Shell">SSH</abbr> clients.</p>
<p>For example, with SSH:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">find [your path] -type f -exec chmod 644 {} \;
find [your path] -type d -exec chmod 755 {} \;</pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Move the configuration file (wp-config.php).</h3>
<p>From WordPress 2.6 it became possible to move the configuration file up a directory and out of the WordPress root folder.</p>
<p>For example, if WordPress is located in the following directory:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">public_html/wordpress/wp-config.php</pre></div></div>

<p>You can move it to the following directory:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">public_html/wp-config.php</pre></div></div>

<p>WordPress automatically checks the parent directory if the configuration file is not found in your website&#8217;s root directory.</p>
<p>This makes it nearly impossible for anyone to access your configuration file as it now resides outside the website&#8217;s root directory.</p>
<h3>Move the wp-content directory.</h3>
<p>Like the configuration file, WordPress 2.6 added the ability to move the wp-content directory to another location.</p>
<p>Once moved, make two additions to the configuration file to identify the new location:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content');
define('WP_CONTENT_URL','http://domain.com/blog/wp-content');</pre></div></div>

<p>You may also need to define the new location for plugins:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins');
define('WP_PLUGIN_URL','http://domain.com/blog/wp-content/plugins');</pre></div></div>

<p>If hackers can&#8217;t find your wp-content folder&#8217;s location, clearly it becomes far more difficult for them to hack it.</p>
<h3>Stay current with all updates.</h3>
<p>The main WordPress installation files,  plugins and themes can be updated easily via the admin interface. Make sure you do so each time a new version of either are released.</p>
<p>For plugins, the plugin change log makes it easy to see what has changed and therefore ensure compatibility with your version of WordPress.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Remove the WordPress version information from your header.</h3>
<p>Viewing source on most WordPress websites will reveal what version of WordPress the website is running.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;meta name=&quot;generator&quot; content=&quot;WordPress 3.0.1&quot; /&gt;&lt;!-- leave this for stats --&gt;</pre></div></div>

<p>This helps hackers find vulnerable blogs or determine ways to hack a particular version.</p>
<p>To remove, find the code shown below in your header.php file and delete it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;meta name=&quot;generator&quot; content=&quot;WordPress &lt;?php bloginfo('version'); ?&gt;&quot; /&gt;&lt;!-- leave this for stats --&gt;</pre></div></div>

<p>The wp_head function also includes the WordPress version in your header. To remove, include the following line of code in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">remove_action('wp_head','wp_generator');</pre></div></div>

<h3>Use secret keys.</h3>
<p>A secret key is a hashing salt, which makes your website harder to hack by adding random elements to the password. These secret keys are found in the WordPress configuration (wp-config.php) file.</p>
<p>Visit the following URL to get the secret keys: <a href="https://api.wordpress.org/secret-key/1.1/salt/" title="WordPress secret key generator" target="_blank" rel="nofollow">https://api.wordpress.org/secret-key/1.1/salt/</a></p>
<p>Replace the following in the configuration file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('AUTH_KEY','put your unique phrase here');
define('SECURE_AUTH_KEY','put your unique phrase here');
define('LOGGED_IN_KEY','put your unique phrase here');
define('NONCE_KEY','put your unique phrase here');
define('AUTH_SALT','put your unique phrase here');
define('SECURE_AUTH_SALT','put your unique phrase here');
define('LOGGED_IN_SALT','put your unique phrase here');
define('NONCE_SALT','put your unique phrase here');</pre></div></div>

<p>With the generated keys (example only):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('AUTH_KEY','*QCT0a,T+3hxeg)ti7k}#~&lt;AQSmm&amp;x+ff=*$d:)&lt;-;+!a?yS{ArmuR-#*GyLCgI)');
define('SECURE_AUTH_KEY','[)|y._i~B5js,h3@4%M[&lt;l:DJ&amp;]Ou$2|n(e?DJ`+R4pk6um/6zS%6@@i{^N-6(4]');
define('LOGGED_IN_KEY','@+l2X{3wvy/1K[zRm|P_r;WixJ:,&gt;V&amp;JL![gyJq ?b[Wf.W|U_MKutdrL*$l][-S');
define('NONCE_KEY','T$R&gt;#*2)2kO?NIr&amp;o|&gt;[L&gt;T5%YGd^yJ+eE$7wkcL-?1v]-X*{f`Pg)NZqKU}^e8R');
define('AUTH_SALT','&lt;8JD%+O!t.F%]6RaO9L_MI&lt;w2Lw_-Bc5u_(WDdPoO0D;j9zwu*?1i{%nH/RBjF6J');
define('SECURE_AUTH_SALT','oS|EP&amp;Pm`bf8iG!C&lt;X8#yFG%8J)x G+3M`wRBtp#]7)&amp;hj}ZV/p&gt; yh-BtbBRbTk');
define('LOGGED_IN_SALT','tW4|J/m|habEJ+BTvF0PfpuiOgf-6,dIav-5K|FTM$&amp;Agy;FqDjp|5Ci7&gt;nJFD/#');
define('NONCE_SALT','T-v&amp;f++w!c%5zs2t8qH?,n,/WE&amp;uWd--o4t{FL49/4e~|e+HV+.~A?JYZ1Ev&lt;5)u');</pre></div></div>

<p>You can add or amend the secret keys at anytime. This will invalidate all existing cookies and require users to login again.</p>
<h3>Change the WordPress table prefix.</h3>
<p>You can define the WordPress database table prefix in the WordPress configuration file. By default, the prefix is set to:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$table_prefix = 'wp_';</pre></div></div>

<p>Change this to whatever you prefer.</p>
<p>If you already have a version of WordPress installed, you will need to manually amend the database table names in MySQL, or do a clean install and data import.</p>
<h3>Force <abbr title="Secure Sockets Layer">SSL</abbr> on login and admin access.</h3>
<p>Set the following option in the WordPress configuration file to force <abbr title="Secure Sockets Layer">SSL</abbr> (<abbr title="Secure HyperText Transfer Protocol">HTTPS</abbr>) on the login and admin screens.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('FORCE_SSL_LOGIN',true);
define('FORCE_SSL_ADMIN',true);</pre></div></div>

<h3>Use <abbr title="Internet Protocol">IP</abbr> lockdown on the wp-admin directory.</h3>
<p>Create an <code>.htaccess</code> file in your wp-admin directory with the following lines of code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName &quot;Access Control&quot;
AuthType Basic
order deny, allow
deny from all
#IP whitelist
allow from 72.14.207.99
allow from 216.239.51.99</pre></div></div>

<p>Where the <abbr title="Internet Protocol">IP</abbr> address lines are whatever your chosen <abbr title="Internet Protocol">IP</abbr> addresses are. Only users with these <abbr title="Internet Protocol">IP</abbr> addresses will have access to the wp-admin folder and hence the admin part of the blog.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://codex.wordpress.org/Hardening_WordPress" title="WordPress Codex: Hardening WordPress" target="_blank" rel="nofollow">http://codex.wordpress.org/Hardening_WordPress</a></li>
<li><a href="http://codex.wordpress.org/Changing_File_Permissions" title="WordPress Codex: Changing File Permissions" target="_blank" rel="nofollow">http://codex.wordpress.org/Changing_File_Permissions</a></li>
<li><a href="http://codex.wordpress.org/Editing_wp-config.php" title="WordPress Codex: Editing the WordPress Configuration File" target="_blank" rel="nofollow">http://codex.wordpress.org/Editing_wp-config.php</a></li>
<li><a href="http://codex.wordpress.org/htaccess_for_subdirectories" title="WordPress Codex: Htaccess for Subdirectories" target="_blank" rel="nofollow">http://codex.wordpress.org/htaccess_for_subdirectories</a></li>
</ul>
<p>If you have any more suggestions, that don&#8217;t necessitate plugins, feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/secure-your-wordpress-installation/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Installing MySQL on Mac OSX 10.6 (Snow Leopard)</title>
		<link>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard</link>
		<comments>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard#comments</comments>
		<pubDate>Wed, 31 Mar 2010 22:20:42 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=2194</guid>
		<description><![CDATA[If you’re comfortable with installing applications on your Mac and are reasonably familiar with MySQL, installing MySQL on Snow Leopard should be relatively simple. Here are the simple steps you need to do to get MySQL up and running on your local machine.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re comfortable with installing applications on your Mac and are reasonably familiar with MySQL, installing MySQL on Snow Leopard should be relatively simple.</p>
<ol>
<li>Download the Mac OSX disk image from the MySQL website:
<p><a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" title="MySQL package for Mac OSX" target="_blank" rel="nofollow">http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg</a></p>
<p>I used the <strong>mysql-5.1.42-osx10.5-x86_64.dmg</strong> disk image, which seems to work fine. The image contains 4 files including a ReadMe file.</li>
<li>Install the following packages found in the disk image to the default location and with the default options:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql-5.1.42-osx10.5-x86_64.pkg
MySQLStartupItem.pkg</pre></div></div>

</li>
<li>Install the following profile found in the disk image to the default location and with the default options:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">MySQL.prefPanel</pre></div></div>

</li>
<li>Start the MySQL service in the System Preferences panel and check the <em>Automatically Start the MySQL Service on Startup</em> option.</li>
</ol>
<p>That is all you need to do. However, if you&#8217;re working with PHP, you will need to correctly reference the <code>mysql.sock</code> file in your <code>php.ini</code> file. To do this, find the following line and ensure the reference is correct:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql.default_socket = /tmp/mysql.sock</pre></div></div>

<p>(Remember to restart Apache if you make changes to your <code>php.ini</code> file.)</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Setting up PHP on Mac OSX 10.6 (Snow Leopard)</title>
		<link>http://www.simonwhatley.co.uk/setting-up-php-on-mac-osx-10-6-snow-leopard</link>
		<comments>http://www.simonwhatley.co.uk/setting-up-php-on-mac-osx-10-6-snow-leopard#comments</comments>
		<pubDate>Wed, 31 Mar 2010 20:40:05 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[http.conf]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X 10.5]]></category>
		<category><![CDATA[Mac OS X 10.6]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=2197</guid>
		<description><![CDATA[Since Apple launched Mac OS X 10.5 (Leopard), PHP has been installed by default, albeit disabled. Here is a quick run through of what you need to do to get it up and running.]]></description>
			<content:encoded><![CDATA[<p>Since Apple launched Mac OS X 10.5 (Leopard), PHP has been installed by default, albeit disabled. Here is a quick run through of what you need to do to get it up and running:</p>
<ol>
<li>Enable the PHP5 module in Apache:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LoadModule php5_module libexec/apache2/libphp5.so</pre></div></div>

<p>This will normally involve simply removing the hash symbol (#) at the beginning of the line.</li>
<li>Restart Apache via the command line:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo apachectl restart -t</pre></div></div>

<p>The <code>-t</code> is used to run a syntax check on the Apache file, to ensure you haven&#8217;t broken anything.
</li>
<li>Locate the <code>php.ini.default</code> file in the <code>/etc/</code> directory and rename it to simply <code>php.ini</code> by running the following commands:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /etc
sudo cp php.ini.default php.ini
sudo chmod 666 php.ini</pre></div></div>

</li>
<li>Create a file in the web server&#8217;s document root, in this case an <code>index.php</code> file, with the following text included:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;?php phpinfo() ?&gt;</pre></div></div>

<p>When you browse to that file, it will display information regarding your PHP installation. (Be sure to remove this after use and certainly don&#8217;t include it in a production environment.)</li>
</ol>
<p>That is all you need to do. Easy huh?</p>
<p>As a point to note, if you need to make changes to either the <code>http.conf</code> file or <code>php.ini</code>, you will need administrative access and will need to restart the Apache server for the chances to take effect.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/setting-up-php-on-mac-osx-10-6-snow-leopard/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programmer’s Dozen &#8211; Programming Best Practices</title>
		<link>http://www.simonwhatley.co.uk/programmers-dozen-programming-best-practices</link>
		<comments>http://www.simonwhatley.co.uk/programmers-dozen-programming-best-practices#comments</comments>
		<pubDate>Tue, 03 Mar 2009 11:23:46 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[fuzzy logic]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[object orientated]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1826</guid>
		<description><![CDATA[Take control of your code with these programming best practices from Kevlin Henney. At JAOO Aarhus 2008 Kevlin used a trash can, vampires, a train wreck, whiskey and much more to make you understand and remember his 13 constructive points (a programmer’s dozen) about programming and code smells.]]></description>
			<content:encoded><![CDATA[<p>Take control of your code with these programming best practices from Kevlin Henney. At <abbr title="Java and object-oriented software engineering">JAOO</abbr> Aarhus 2008 Kevlin used a trash can, vampires, a train wreck, whiskey and much more to make you understand and remember his 13 constructive points (a programmer’s dozen) about programming and code smells.</p>
<p>The 13 points made by Kevlin were:</p>
<ul>
<li>0. Prefer code to comments.</li>
<li>1. Follow a consistent form.</li>
<li>2. Employ the contract metaphor.</li>
<li>3. Express independent ideas independently.</li>
<li>4. Encapsulate.</li>
<li>5. Parameterize from above.</li>
<li>6. Restrict mutability of state.</li>
<li>7. Favor symmetry over asymmetry.</li>
<li>8. Sharpen fuzzy logic.</li>
<li>9. Go with the flow.</li>
<li>10. Let code decide.</li>
<li>11. Omit needless code.</li>
<li>12. Unify duplicate code.</li>
</ul>
<p>You can see a <a href="http://blog.jaoo.dk/2009/01/19/programmers-dozen-programming-best-practices/" title="Programmer’s Dozen - Programming Best Practices" target="_blank" rel="nofollow">video of Kevlin&#8217;s presentation</a> on the <a href="http://jaoo.dk/" title="JAOO" target="_blank" rel="nofollow">JAOO website</a>.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/programmers-dozen-programming-best-practices/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Search Engine Safe URLs with Apache and htaccess</title>
		<link>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess</link>
		<comments>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess#comments</comments>
		<pubDate>Mon, 08 Dec 2008 15:57:15 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[All]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ColdBox]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Fusebox]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[ISAPI]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[New Brunswick]]></category>
		<category><![CDATA[None]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[search engine optimisation]]></category>
		<category><![CDATA[search engine robots]]></category>
		<category><![CDATA[search engine safe]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[URL rewriting]]></category>
		<category><![CDATA[USD]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1635</guid>
		<description><![CDATA[An increasingly popular technique among websites and in particular, blogs, is the idea of making URLs search engine friendly, or safe, on the premise that doing so will help search engine optimisation. By removing the obscure query string element of a URL and replacing it with keyword rich alternatives, not only makes it more readable for a human being, but also the venerable robots that allow our page content to be found in the first place.]]></description>
			<content:encoded><![CDATA[<p>An increasingly popular technique among websites and in particular, blogs, is the idea of making <abbr title="Universal Resource Locator">URL</abbr>s search engine friendly, or safe, on the premise that doing so will help search engine optimisation. By removing the obscure query string element of a <abbr title="Universal Resource Locator">URL</abbr> and replacing it with keyword rich alternatives, not only makes it more readable for a human being, but also the venerable robots that allow our page content to be found in the first place.</p>
<p>For example, the following is WordPress&#8217; default URL configuration for a post:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.domain.com/?p=1635</pre></div></div>

<p>However, buy using a URL-rewriting available in the Apache webserver, we can achieve a far better result, such as the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.domain.com/search-engine-safe-urls</pre></div></div>

<p>NB. It is also possible to achieve a similar result with an <abbr title="Internet Server Application Programming Interface">ISAPI</abbr> rewrite for Microsoft&#8217;s <abbr title="Internet Information Server">IIS</abbr> webserver, but this topic will not be included in this post.</p>
<p>To get your website working with <abbr title="search engine safe">SES</abbr> <abbr title="Universal Resource Locator">URL</abbr>s you need to enable both the <code>mod_rewite</code> module and <code>AllowOverride</code> directive in the Apache configuration file.</p>
<p>Uncomment (remove #) from the following to enable the re-write rule:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Change the <code>AllowOverride</code> directive from none to all</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;directory /&gt;
    Options FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all
&lt;/directory&gt;
&nbsp;
&lt;directory &quot;C:/WebRoot&quot;&gt;
    # Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
&nbsp;
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All
&nbsp;
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
&lt;/directory&gt;</pre></div></div>

<p>On Apache webservers, <code>.htaccess</code> (hypertext access) is the default name of directory-level configuration files. An <code>.htaccess</code> file is placed in a particular directory, and the directives in the <code>.htaccess</code> file apply to that directory, and all its subdirectories. It provides the ability to customize configuration for requests to the particular directory. In our case, enabling search engine safe (<abbr title="search engine safe">SES</abbr>) <abbr title="Universal Resource Locator">URL</abbr>s.</p>
<p>By setting the <code>AllowOverride</code> directive to <q>All</q> in effect defers configuration settings to the <code>.htaccess</code> file.</p>
<p>An example <code>.htaccess</code> file could include the following code to rewrite the URLs:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]</pre></div></div>

<p>Search engine friendly <abbr title="Universal Resource Locator">URL</abbr>s are implemented with Rewrite engines. The rewrite engine modifies the <abbr title="Universal Resource Locator">URL</abbr> based upon a number of rewrite conditions and rules.</p>
<p>The <code>RewriteBase</code> directive explicitly sets the base <abbr title="Universal Resource Locator">URL</abbr> for per-directory rewrites. The <code>RewriteCond</code> directive defines a rule condition, so in this case handling missing files or directories. Finally, the <code>RewriteRule</code> directive is the real rewriting workhorse. In this example, we&#8217;re getting everything in the <abbr title="Uniform Resource Identifier">URI</abbr> &#8212; i.e. not including the protocol (HTTP/S) and domain name &#8212; based upon a regular expression. This is then appended to the default file reference &#8212; index.php &#8212; as a <a href="http://www.regular-expressions.info/brackets.html" title="Regular Expression: back references" target="_blank" rel="nofollow">back reference</a>. The <code>[L,QSA]</code> refers to the rule being the last rule and append any query string parameters to the default file. It is important to note that this is all done on the server side, the user will never see the website address changing in the browser&#8217;s address bar. Furthermore, simply transposing the index.php filename with your default file name &#8212; e.g. index.cfm, default.aspx &#8212; will have the same result. Indeed, the above rewrite rules are becoming a de-facto standard for web applications.</p>
<p>To fully understand <code>mod_rewrite</code> rules above, look at the <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html" title="Apache mod_rewrite documentation" target="_blank" rel="nofollow">Apache mod_rewrite documentation</a>.</p>
<p>Once you have your <abbr title="Search Engine Safe">SES</abbr> functionality in place on the webserver, it is then the responsibility of your application framework to understand the <abbr title="Universal Resource Locator">URL</abbr> construction and handle it accordingly. Fortunately, frameworks such as <a href="http://www.coldboxframework.com" title="ColdBox Framework" target="_blank" rel="nofollow">ColdBox</a> and <a href="http://www.fusebox.org" title="Fusebox Framework" target="_blank" rel="nofollow" >Fusebox</a> for ColdFusion, <a href="http://framework.zend.com" title="Zend PHP framework" target="_blank" rel="nofollow">Zend</a> and <a href="http://www.symfony-project.com" title="Symfony PHP fraemwork" target="_blank" rel="nofollow">Symfony</a> for <abbr title="PHP Hypertext Precursor">PHP</abbr>, all contain functionality to do this, but that is the subject of an entirely different post.</p>
<p>Users of web applications prefer short, neat <abbr title="Universal Resource Locator">URL</abbr>s to raw query string parameters. A concise <abbr title="Universal Resource Locator">URL</abbr> is easy to remember, and less time-consuming to type in. If the <abbr title="Universal Resource Locator">URL</abbr> can be made to relate clearly to the content of the page, then errors are not only less likely to happen, but our good friends the search engine robots are able to draw a stronger assumption of the pages&#8217; relevance and content.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using the MooTools Autocompleter Plugin with ColdFusion</title>
		<link>http://www.simonwhatley.co.uk/using-the-mootools-autocompleter-plugin-with-coldfusion</link>
		<comments>http://www.simonwhatley.co.uk/using-the-mootools-autocompleter-plugin-with-coldfusion#comments</comments>
		<pubDate>Thu, 21 Aug 2008 10:57:35 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Australia]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[autocompleter]]></category>
		<category><![CDATA[Bulgaria]]></category>
		<category><![CDATA[CNet]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Dylan Verheul]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Harald Kirschner]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript Object Notation]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[New Brunswick]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search interface]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[united kingdom]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=883</guid>
		<description><![CDATA[In a previous post, I demonstrated how to implement Dylan Verheul’s jQuery Autocomplete plugin. Not content with demonstrating one library's plugin, it is now the turn of Mootools.]]></description>
			<content:encoded><![CDATA[<p>In a <a href="/using-jquery-auto-complete-with-coldfusion" title="Using jQuery Auto-Complete with ColdFusion">previous post</a>, I demonstrated how to implement Dylan Verheul&#8217;s <a href="http://www.dyve.net/jquery/?autocomplete" title="jQuery Autocomplete Plugin" target="_blank" rel="nofollow">jQuery Autocomplete plugin</a>. Not content with demonstrating one library&#8217;s plugin, it is now the turn of <a href="http://mootools.net/" title="MooTools JavaScript Framework" target="_blank" rel="nofollow">MooTools</a>.</p>
<blockquote><p>MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.</p></blockquote>
<p>In this post I will show you how to implement the <a href="http://digitarald.de/project/autocompleter/" title="Autocompleter Plugin" target="_blank" rel="nofollow">AutoCompleter plugin</a> by Harald Kirschner. Kirschner&#8217;s AutoCompleter plugin script for MooTools provides the functionality for text suggestion and completion. It features different data-sources (local, <acronym title="JavaScript Object Notation">JSON</acronym> or <abbr title="eXtensible Markup Language">XML</abbr>), a variety of user interactions, custom formatting, multiple selection, animations and much more.</p>
<h3>The Goal</h3>
<p>The goal of this post will be the same as the <a href="/using-jquery-auto-complete-with-coldfusion" title="Using jQuery Auto-Complete with ColdFusion">jQuery autocomplete post</a>: Allow the user to type a few characters into a standard form text input field and to automatically provide suggestions from which the user can select.</p>
<h3>Prerequisites</h3>
<ol>
<li>The <a href="http://mootools.net/download" title="Mootools Download" target="_blank" rel="nofollow">latest copy of MooTools</a></li>
<li>A basic understanding of JavaScript and <acronym title="JavaScript Object Notation">JSON</acronym></li>
<li>A server-side script that can respond to the <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> request, in our case ColdFusion</li>
</ol>
<h3>Demo</h3>
<p>The demo below will show how to interact with a simple ColdFusion script, but I&#8217;ll also provide <a href="/examples/autocomplete/mootools/" title="More examples">more (advanced) examples</a> in the <a href="/examples/autocomplete/mootools/autocomplete.zip" title="Download the files">download</a>.</p>
<h3>How It Works</h3>
<p>Once the user begins to type into the form text input field, the MooTools auto-complete is activated. After a set character length and time interval (both optional), a list of items is displayed below the input field. The user can select an item with either the arrow keys or mouse.</p>
<p>NB. Clicking back in the input field will repopulate the auto-complete list, if options are available, so that the user can change the selection. Deleting part of the chosen item will also trigger a new selection list.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>The Code</h3>
<p>There are three parts to this demo:</p>
<ol>
<li>The page’s HTML.</li>
<li>The server-side code to produce the dynamic page (i.e. to load the autocomplete <code>div</code> when the user types something into the input field).</li>
<li>The MooTools JavaScript.</li>
</ol>
<p><strong>HTML Form</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;h1&gt;Example: Country Lookup&lt;/h1&gt;
&lt;p&gt;Using &lt;abbr title=&quot;Asynchronous JavaScript and XML&quot;&gt;AJAX&lt;/abbr&gt; to interrogate the database.&lt;/p&gt;
&lt;p&gt;Example data: Australia, Bulgaria, United Kingdom&lt;/p&gt;
&lt;form name=&quot;frmAutoCompleteCountry&quot; id=&quot;frmAutoCompleteCountry&quot; action=&quot;#&quot; method=&quot;post&quot;&gt;
&lt;p&gt;
&lt;label for=&quot;country&quot;&gt;Country&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;country&quot; id=&quot;country&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;</pre></div></div>

<p><strong>ColdFusion</strong></p>
<p>Below is a simple ColdFusion component that takes a string as an argument. This string is part or all of the country name. The query results are parsed as an array and returned from the function, as <acronym title="JavaScript Object Notation">JSON</acronym>, to the MooTools auto-complete function.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfcomponent</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
&nbsp;
	<span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;getCountry&quot;</span> <span style="color: #0000ff">access</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;remote&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000ff">returntype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;array&quot;</span> returnf<span style="color: #0000ff;">or</span>mat<span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;json&quot;</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;country&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> <span style="color: #0000ff;">var</span> qryCountry <span style="color: #0000ff">=</span> <span style="color: #800080;">queryNew</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">'country'</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> <span style="color: #0000ff;">var</span> arrCountry <span style="color: #0000ff">=</span> <span style="color: #800080;">arrayNew</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfquery</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;qryCountry&quot;</span> <span style="color: #0000ff">datasource</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;test&quot;</span><span style="color: #800000;">&gt;</span></span>
		SELECT countryName
		FROM country
		WHERE countryName LIKE <span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;%#ARGUMENTS.country#%&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;/cfquery&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfloop</span> <span style="color: #0000ff">query</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;qryData&quot;</span><span style="color: #800000;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> arrCountry<span style="color: #000000;">&#91;</span>currentRow<span style="color: #000000;">&#93;</span> <span style="color: #0000ff">=</span> qryCountry.countryName<span style="color: #000000;">&#91;</span>currentRow<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;/cfloop&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000ff;">&lt;</span>cfreturn arrCountry <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #800000;">&lt;/cfcomponent&gt;</span></span></pre></div></div>

<p><strong>JavaScript</strong></p>
<p>The JavaScript will attach itself after the <acronym title="Document Object Model">DOM</acronym> is ready &#8212; this more or less relates to when the page has loaded in the browser. Each time the text input field, with the ID of country, is changed, the <code>Autocompleter.Ajax.Json</code> event is fired. This makes a call to the ColdFusion component, which returns a <acronym title="JavaScript Object Notation">JSON</acronym> object of matched items. This <acronym title="JavaScript Object Notation">JSON</acronym> object is interpreted by the plugin and rendered as an <abbr title="Hyper-Text Markup Language">HTML</abbr> un-ordered list.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;mootools.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;Observer.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;Autocompleter.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;Autocompleter.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
window.addEvent('domready', function() {
	new Autocompleter.Ajax.Json(
		'country',
		'data/Country.cfc?method=getCountry&amp;returnformat=json&amp;country=' + $('country').getProperty('value')
		, {
			'minLength': 1, // We wait for at least one character
			'overflow': true // Overflow for more entries'
	});
});
&lt;/script&gt;</pre></div></div>

<h3>Where to Take it Next</h3>
<p><strong>Unobtrusive JavaScript</strong></p>
<p>As with any page that is loaded with JavaScript and <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> functionality, it should work without JavaScript.</p>
<p>To achieve this with the above tutorial, you will need to replace the MooTools autocomplete functionality with an ‘interim’ page that allows a user to select from a list of items, effectively turning the input field into a simple search interface. Of course, all other form field information would need to be retained between pages.</p>
<h3>Download the Code</h3>
<p>The <a href="/examples/autocomplete/mootools/autocomplete.zip" title="Download the example code">example code</a> can be downloaded from the demo page. Included are ColdFusion and PHP examples.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/using-the-mootools-autocompleter-plugin-with-coldfusion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion Becomes a Teenager</title>
		<link>http://www.simonwhatley.co.uk/coldfusion-becomes-a-teenager</link>
		<comments>http://www.simonwhatley.co.uk/coldfusion-becomes-a-teenager#comments</comments>
		<pubDate>Thu, 10 Jul 2008 18:14:36 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[1999]]></category>
		<category><![CDATA[2001]]></category>
		<category><![CDATA[2005]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[Allaire]]></category>
		<category><![CDATA[Centaur]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Markup Language]]></category>
		<category><![CDATA[Derby]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Internet Applications]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jeremy Allaire]]></category>
		<category><![CDATA[JJ Allaire]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[macromedia]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Neo]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scorpio]]></category>
		<category><![CDATA[Visual C++]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=591</guid>
		<description><![CDATA[Today ColdFusion moved into the next stage of its life and became a teenager, hopefully not a precocious one!]]></description>
			<content:encoded><![CDATA[<p>Today ColdFusion moved into the next stage of its life and became a teenager, hopefully not a precocious one!</p>
<p><strong>Happy 13<sup>th</sup> Birthday ColdFusion.</strong></p>
<p>Adobe ColdFusion has had a long and illustrious life. The first version of ColdFusion&#8211;written almost entirely by one person, JJ Allaire and then called &#8220;Cold Fusion&#8221;&#8211;was released in 1995. This first version, although revolutionising how web applications were built, was primitive by modern standards, doing little more than database access.</p>
<p>Although originally built in Visual C++, Allaire, around 1999, took the decision to rewrite the entire ColdFusion engine in Java&#8211;a project named &#8220;Neo&#8221;&#8211;which would allow for greater portability among different platforms. The rewrite, released under the monicker MX 6, would prove to be somewhat problematic and a wholescale update to the version resulted.</p>
<p>In 2001 Allaire was acquired by Macromedia. This union brought with it the integration of Macromedia&#8217;s Flash platform via Flash Remoting; a huge step towards rich Internet applications.</p>
<p>In 2005 it was the turn of Macromedia to be acquired and they merged with Adobe. A period of instability in the ColdFusion world resulted, brought about by the knowledge that Adobe was a company that developed tools, not programming languages. However, following a successful release of ColdFusion 8 in 2007 and the announcement that a version 9 would be developed, code-named &#8220;Centaur&#8221;, fears about ColdFusion&#8217;s future have subsided&#8211;albeit the continued debate over &#8220;ColdFusion is Dead&#8221; remains boiling in the background.</p>
<p>The primary distinguishing feature of ColdFusion is its associated scripting language, ColdFusion Markup Language (<abbr title="ColdFusion Markup Language">CFML</abbr>), which compares favourably to its rivals, <abbr title="Java Server Pages">JSP</abbr>, <abbr title="Active Server Pages">ASP</abbr>.NET, or <abbr title="PHP Hypertext Preprocessor">PHP</abbr> and resembles <abbr title="HyperText Markup Language">HTML</abbr> in syntax. &#8220;ColdFusion&#8221; is often used synonymously with &#8220;CFML&#8221;, but it should be noted that there are additional <abbr title="ColdFusion Markup Language">CFML</abbr> application servers besides ColdFusion, and that ColdFusion supports programming languages other than <abbr title="ColdFusion Markup Language">CFML</abbr>, such as server-side Actionscript and embedded scripts that can be written in a JavaScript-like language, known as <abbr title="ColdFusion">CF</abbr>Script. Adobe ColdFusion also includes native support for Flex, <abbr title="Portable Document Format">PDF</abbr>, Verity and the embedded Derby database amongst a host of <a href="http://www.adobe.com/products/coldfusion/features/" title="Features of Adobe ColdFusion" target="_blank" rel="nofollow">other features</a>.</p>
<p>ColdFusion 9 is set to be an exciting release, much like its predecessor, with more features added to the core tag set, whilst also integrating other technologies such <acronym title="Adobe Integrated Runtime">AIR</acronym> and Hibernate.</p>
<p>Exciting times lay ahead. Let&#8217;s hope Adobe takes full advantage with such a fine product.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong>See Also:</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/ColdFusion" title="ColdFusion" target="_blank" rel="nofollow">ColdFusion</a> Wikipedia entry</li>
<li><a href="http://en.wikipedia.org/wiki/ColdFusion_Markup_Language" title="ColdFusion Markup Language" target="_blank" rel="nofollow">ColdFusion Markup Language</a> Wikipedia entry</li>
<li><a href="http://www.www.railo-technologies.com/" title="Railo" target="_blank" rel="nofollow">Railo</a> &#8211; Free, Open Source alternative <abbr title="ColdFusion Markup Language">CFML</abbr> Engine</li>
<li><a href="http://www.smithproject.org" title="SmithProject" target="_blank" rel="nofollow">SmithProject</a> &#8211; Free, Open Source alternative <abbr title="ColdFusion Markup Language">CFML</abbr> Engine</li>
<li><a href="http://www.newatlanta.com/bluedragon/" title="BlueDragon" target="_blank" rel="nofollow">BlueDragon</a> &#8211; Free, Open Source alternative <abbr title="ColdFusion Markup Language">CFML</abbr> Engine</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/coldfusion-becomes-a-teenager/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBC Appealing to the Facebook Generation</title>
		<link>http://www.simonwhatley.co.uk/bbc-appealing-to-the-facebook-generation</link>
		<comments>http://www.simonwhatley.co.uk/bbc-appealing-to-the-facebook-generation#comments</comments>
		<pubDate>Thu, 13 Mar 2008 12:30:23 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Strategy]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[bbc]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[homepage]]></category>
		<category><![CDATA[iGoogle]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[My Yahoo]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Web]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[User Interface Design]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Portal]]></category>
		<category><![CDATA[Windows Live]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=459</guid>
		<description><![CDATA[I’m not a big fan of the BBC’s recent website redesign! While I believe that a few structural and hierarchical elements could have been addressed better, the overall result of this redesign is too “Facebook” and Web 2.0 for my liking; exactly what an online news site does not need. Who are the BBC trying to appeal to? They have gone from being content centric to design and technology centric. This in itself isn’t a bad thing, but I don’t understand the BBCs motivation for doing so.]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/bbc_homepage_logo.thumbnail.png' alt='BBC Homepage Logo' style="float:left; margin-right:10px;" />I&#8217;m not a big fan of the <acronym title="British Broadcasting Corporation">BBC</acronym>&#8216;s recent website redesign! While I believe that a few structural and hierarchical elements could have been addressed better, the overall result of this redesign is too &#8220;Facebook&#8221; and <a href="http://en.wikipedia.org/wiki/Web_2" title="Wikipedia Web 2.0" rel="nofollow">Web 2.0</a> for my liking; exactly what an online news site does not need. Who are the <acronym title="British Broadcasting Corporation">BBC</acronym> trying to appeal to? They have gone from being content centric to design and technology centric. This in itself isn&#8217;t a bad thing, but I don&#8217;t understand the <acronym title="British Broadcasting Corporation">BBC</acronym>s motivation for doing so.</p>
<p>Richard Titus, the Acting Head of User Experience at the <acronym title="British Broadcasting Corporation">BBC</acronym> was a key driver of the project.</p>
<blockquote><p>From a conceptual point of view, the widgetisation adopted by <a href="http://www.facebook.com" title="Facebook" target="_blank" rel="nofollow">Facebook</a>, <a href="http://www.google.com/ig" title="iGoogle" target="_blank" rel="nofollow">iGoogle</a> and <a href="http://www.netvibes.com/" title="netvibes" target="_blank" rel="nofollow">netvibes</a> weighed strongly on our initial thinking.</p></blockquote>
<p>Titus identifies the key features of the new homepage as being:</p>
<ul>
<li>Simple, clean and beautiful, the final design, &#8230; visually striking yet unpretentious.</li>
<li>Personalization: you can choose the content that interests you by adding and removing the content boxes via the &#8220;Customise Your Homepage&#8221; tab.</li>
<li>Localization: Users can now set their own location, enabling them to access local sites, weather, news, radio and TV schedules without the hassle often associated with user journeys to local content.</li>
<li>Simplicity: the customization is intuitive and includes an interactive demo and tips to guide users through the process. It is also unobtrusive if the user has no desire to customize their page their experience won&#8217;t be compromised.</li>
<li>Search: The site is much easier to read and scan at a glance. At the top of the page there&#8217;s a search function (now reduced from two search boxes to one), and at the bottom a full directory of all <acronym title="British Broadcasting Corporation">BBC</acronym> sites and a link to the A-Z, allowing users to quickly find what they&#8217;re looking for.</li>
<li>Nostalgia: the new homepage also manages to incorporate eccentricity alongside innovation.</li>
</ul>
<p><strong>Aesthetically bold and bright.</strong></p>
<p>Aesthetically, the new homepage looks nice. It&#8217;s big, bold and bright &#8211; a far cry from the old days when <acronym title="British Broadcasting Corporation">BBC</acronym> sites had text almost too small to read and a fixed-width design optimised for tiny monitors. But at the same time it appears far too clunky! I&#8217;d prefer something that would look a little more elegant and understated. Something that doesn&#8217;t appeal to <em>The Facebook Generation</em>, who are less likely to read the <acronym title="British Broadcasting Corporation">BBC</acronym> pages at lunchtime, than update their Facebook, Bebo or Twitter profile during that &#8216;valuable&#8217; hour. This begs the question, does the <acronym title="British Broadcasting Corporation">BBC</acronym> know who their core audience is?</p>
<p><strong>Confusing interactions.</strong></p>
<p>The homepage makes great use of AJAX, but at the same time, there are a number of confusing interactions going on. For instance, the &#8216;Edit&#8217; button next to each area of customisable content seems like the wrong label text. I&#8217;m not editing the news, the weather or blogs &#8211; I&#8217;m selecting which news categories I want to see, where I am and which blogs I want to read. These types of button ought to be contextual rather than generic. Edit is simply too vague.</p>
<p>Also, what&#8217;s the idea behind those plus and minus buttons for news? Strange idea. Add or remove articles from the displayed list? Why would you want to remove them from view sequentially? If the idea was to allow the user to asynchronously update a short list of available headlines, then why not move back/forwards in blocks of five? Plus and minus are often used as metaphors for creation/deletion in software, so the usage doesn&#8217;t seem right.</p>
<p><strong>Personalisation vs Simplicity &#8230; an uneasy relationship</strong></p>
<p align="center"><img src='http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/bbc_customise_homepage.png' alt='BBC Customise Homepage' /></p>
<p>The ability to personalise a website is, in general, a good thing. Google has done it with their <a href="http://www.google.com/ig" title="iGoogle" target="_blank" rel="nofollow">iGoogle</a>, Yahoo! with <a href="http://my.yahoo.com" title="My Yahoo" target="_blank" rel="nofollow">My Yahoo</a> and Microsoft with <a href="http://www.live.com" title="Windows Live" target="_blank" rel="nofollow">Windows Live</a>.  But I think the balance here is gone too far towards design and borrowing from succesful Web 2.0 sites. The <acronym title="British Broadcasting Corporation">BBC</acronym> website has always been an impressive destination for (relatively) impartial news and current affairs throughout the world, not a <a href="http://en.wikipedia.org/wiki/Web_portal" title="Web Portal Definition" target="_blank" rel="nofollow">Web Portal</a>. Or is this the point? Does the <acronym title="British Broadcasting Corporation">BBC</acronym> want to become a destination for all your information needs and compete with Google, Microsoft and Yahoo?</p>
<p>The <acronym title="British Broadcasting Corporation">BBC</acronym> should consider that 14-25 year old users, what I term <em>The Facebook Generation</em>, will require far greater scope for adding their individuality than is currently available. The social networking generation are page-savvy. They want control of their interface to information, their screen is their window on the world and I don&#8217;t think that you have gone far enough in divesting control of the display of that information to the user.</p>
<p>But for those who aren&#8217;t part of <em>The Facebook Generation</em>, the people who care about getting to the content fast and with little fuss, is the ability to personalise the homepage worthwhile or even simple? I&#8217;m not so sure.</p>
<p><strong>Who needs a clock?</strong></p>
<p><img src='http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/bbc_homepage_clocks.thumbnail.png' alt='BBC Homepage Clocks' style="float:left; margin-right:10px;" /> Finally, the clock and date. What an important waste of webpage &#8216;real estate&#8217;, even though in the <acronym title="British Broadcasting Corporation">BBC</acronym>&#8216;s case I understand it was a throwback to the old clock that preceded individual TV programmes. If you&#8217;ve got a modern computer capable of displaying the clock with the Flash plugin, then you&#8217;ll almost certainly have the date and time visible to you anyway. It&#8217;s needlessly superfluous on a website.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/bbc-appealing-to-the-facebook-generation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generic Syntax Highlighter (GeSHi) for ColdFusion</title>
		<link>http://www.simonwhatley.co.uk/generic-syntax-highlighter-geshi-for-coldfusion</link>
		<comments>http://www.simonwhatley.co.uk/generic-syntax-highlighter-geshi-for-coldfusion#comments</comments>
		<pubDate>Mon, 03 Mar 2008 09:12:47 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[content management systems]]></category>
		<category><![CDATA[GeSHi]]></category>
		<category><![CDATA[highlighter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=458</guid>
		<description><![CDATA[GeSHi started out as a module for the phpBB forum system to enable highlighting of programming languages, which was largely unavailable at the time. Since its conception it has spawned into a standalone project, supported by many web-based PHP content management systems.]]></description>
			<content:encoded><![CDATA[<p><acronym title="Generic Syntax Highlighter">GeSHi</acronym> started out as a module for the <a href="http://www.phpbb.com" title="phpBB forum system" rel="nofollow">phpBB</a> forum system to enable highlighting of programming languages, which was largely unavailable at the time.  Since its conception it has spawned into a standalone project, supported by many web-based <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> content management systems.</p>
<p>Since I&#8217;m a ColdFusion developer, it was necessary to write a language reference file for ColdFusion and in particular, version 8.</p>
<p>You can <a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/cfmphp.txt" title="GeSHi ColdFusion language reference">download the file</a> (30KB) here and upload it into your website&#8217;s <acronym title="Generic Syntax Highlighter">GeSHi</acronym> folder. You will need to rename it to cfm.php.</p>
<p>By including the content between a set of <code>pre</code> tags, &lt;pre lang=&#8221;cfm&#8221;&gt;&lt;/pre&gt;, <acronym title="Generic Syntax Highlighter">GeSHi</acronym> will implement the correct syntax for ColdFusion.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/generic-syntax-highlighter-geshi-for-coldfusion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP.ini Permission Problems on Windows Vista</title>
		<link>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista</link>
		<comments>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista#comments</comments>
		<pubDate>Sun, 17 Feb 2008 22:28:41 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[configuring]]></category>
		<category><![CDATA[difficulties]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Microsoft Vista]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[paths]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[Rob Douglas]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[solutions]]></category>
		<category><![CDATA[solving]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=398</guid>
		<description><![CDATA[Installing PHP is a relatively simple task one would think. Indeed it is simple, but configuring the php.ini isn't; at least not so on Windows Vista! It is infuriating when such a relatively simple task is made inordinately complicated because of the nuances of Vista permissions. What started out as a 5 minute task took a significant number of hours searching for a suitable answer on Google, and not only by myself.]]></description>
			<content:encoded><![CDATA[<p>Installing PHP is a relatively simple task one would think. Indeed it is simple, but configuring the php.ini isn&#8217;t; at least not so on Windows Vista! It is infuriating when such a relatively simple task is made inordinately complicated because of the nuances of Vista permissions. What started out as a 5 minute task took a significant number of hours searching for a suitable answer on Google, and not only by myself.</p>
<p>The task I was trying to achieve was the installation of development versions of <a href="http://wordpress.org" title="WordPress" rel="nofollow">WordPress</a>, <a href="http://drupal.org" title="Drupal" rel="nofollow">Drupal</a>, <a href="http://www.mediawiki.org" title="MediaWiki" rel="nofollow">MediaWiki</a> and <a href="http://moodle.org" title="Moodle" rel="nofollow">Moodle</a>, all of which would require a MySQL database. Trying to load the MySQL extension should have been a simple case of uncommenting the line in the php.ini and restarting the Apache service. With Vista, this was certainly not the case.</p>
<p>I set up a very simple page detailing the <acronym title="PHP: Hypertext Preprocessor">php</acronym> configuration in an index.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This showed me the default configuration path of my php.ini and extensions directory, amongst a whole host of other information.</p>
<p>In both cases the paths were incorrect. First and foremost the configuration file path stated <code>C:\Windows</code> when in fact I had installed it in the root (<code>C:\PHP5</code>). So, although I was amending the php.ini file with the correct detail, Vista was using the default values. If there is no php.ini file in Windows, then you&#8217;ll continue banging your head against a brick wall.</p>
<p>The problems didn&#8217;t stop there. Moving the php.ini file to the Windows directory under Vista isn&#8217;t a simple copy and paste task. You need to be administrator. But Vista&#8217;s administrator priviledges are more pseudo than actual! In order to amend and save the php.ini file in the Windows directory, you must run Notepad as administrator and save the file as such. Voila! Everything then works. The <code>phpinfo()</code> function returned the correct installation detail and I could continue with the job I was meant to be doing.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>PS. Thanks to <a href="http://www.anucreative.com" title="Rob Douglas" rel="nofollow">Rob Douglas</a> for his help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

