<?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>DevGrow &#187; programming</title>
	<atom:link href="http://devgrow.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://devgrow.com</link>
	<description>Tips on web development, web design and online marketing</description>
	<lastBuildDate>Mon, 30 Jan 2012 22:25:50 +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>Poll Results: Who is your current shared or VPS hosting provider?</title>
		<link>http://devgrow.com/poll-results-who-is-your-current-shared-or-vps-hosting-provider/</link>
		<comments>http://devgrow.com/poll-results-who-is-your-current-shared-or-vps-hosting-provider/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 04:27:05 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web hosts]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=2302</guid>
		<description><![CDATA[It turns out that the majority of readers here use either GoDaddy, Linode, MediaTemple or Host Gator as your current shared or VPS hosting provider. Somehow GoDaddy had the most votes (by a small margin) and, at least for me, is the most surprising result. Here&#8217;s a pretty pie graph of the complete spread: For [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that the majority of readers here use either <a href="http://www.godaddy.com/">GoDaddy</a>, <a href="http://devgrow.com/go/linode.com">Linode</a>, <a href="http://www.mediatemple.net/">MediaTemple</a> or <a href="http://devgrow.com/hostgator">Host Gator</a> as your current shared or VPS hosting provider.  Somehow GoDaddy had the most votes (by a small margin) and, at least for me, is the most surprising result.  Here&#8217;s a pretty pie graph of the complete spread:<span id="more-2302"></span></p>
<p><img src="http://cdn.devgrow.com/wp-content/uploads/2011/02/hosts.png" alt="" title="hosts" width="600" height="420" class="aligncenter size-full wp-image-2303" /></p>
<p>For those of you who use GoDaddy, I am very curious &#8211; why did you decide to go with them?  While I use them to host over 40 domain names, I find their overall site and service to be completely gimmicky, spammy and a cluttered mess of sales pitches.  I only use them for domains because it is a bit of a pain to transfer elsewhere, though I may just take the plunge and do that soon, ridding myself of the awful user experience that is GoDaddy.com.</p>
<p>Thankfully, <a href="http://devgrow.com/go/linode.com">Linode</a> was the second most popular host.  I&#8217;ve been recommending them from before they started sponsoring DevGrow and I cannot say enough good things about their overall service, including bang-for-buck, reliability and customer care.  I&#8217;ve used them all in the past &#8211; 1and1, DreamHost, Host Gator, <a href="http://www.slicehost.com/">Slicehost</a>, <a href="http://www.bluehost.com/">BlueHost</a> and Media Temple &#8211; and <strong>NOTHING compares to Linode</strong>.  On that note, however, it is not for everyone.  You have to have a general idea of how to configure your own server to get things working properly, or at least have some interest in it to follow along their <a href="http://library.linode.com/">stellar guides and tutorials</a>.  Someone without any experience can be up and running in a few hours and get everything working smoothly over a day or two.  The benefits are well worth it, from the total control you have over your server to the knowledge/experience you gain.</p>
<p><strong>Have some more insight into the hosts I listed out?  Provide your feedback in the comments!</strong></p>
<h3>New Poll: What Code Editor Do You Use?</h3>
<p>I&#8217;m curious as to what code editor you guys use on a daily basis.  Also, what do you use it for &#8211; programming or CSS/HTML?  I wish there was a way I could get more info directly in the poll itself but additional details will have to wait until I post the results.</p>
<p>As always, be sure to <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> and <a href="http://twitter.com/ThinkDevGrow">follow me on Twitter</a>!</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=2302&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/poll-results-who-is-your-current-shared-or-vps-hosting-provider/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Load Social Media Buttons After Everything Else</title>
		<link>http://devgrow.com/loading-social-media-buttons-after-everything-else/</link>
		<comments>http://devgrow.com/loading-social-media-buttons-after-everything-else/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 19:57:47 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[share buttons]]></category>
		<category><![CDATA[sharebar]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=2146</guid>
		<description><![CDATA[While working on the new theme for this site, I realized that the various social media buttons I use were making the entire page load considerably slower. As soon as the browser hit that region of the page (the end of each post), everything would stop until those pesky buttons were loaded. Using a little [...]]]></description>
			<content:encoded><![CDATA[<p>While working on the new theme for this site, I realized that the various social media buttons I use were making the entire page load considerably slower.  As soon as the browser hit that region of the page (the end of each post), everything would stop until those pesky buttons were loaded.  Using a little bit of jQuery, however, it&#8217;s possible to get around this and load these heavier elements after the rest of the page has finished loading.<span id="more-2146"></span></p>
<h2>The Code</h2>
<p>In order to load the share buttons after everything else, we need to do two things.  First, we need to edit our post template (<code class="codecolorer text geshi"><span class="text">single.php</span></code>) to call a jQuery function <em>after</em> everything has loaded.  We call this function in <code class="codecolorer text geshi"><span class="text">single.php</span></code> instead of an external JavaScript file since some buttons benefit from the post permalink or title, so we need to make sure our buttons have access to that information as well.</p>
<h3>single.php</h3>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; &nbsp; function get_social(permalink,title){<br />
&nbsp; &nbsp; &nbsp; &nbsp; var url = 'share.php';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $('#sharing-buttons').load(url,{permalink:permalink,title:title});<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; $(window).bind(&quot;load&quot;, function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; get_social('<span style="color: #009900;">&lt;?php the_permalink<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span>','<span style="color: #009900;">&lt;?php the_title<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>');<br />
&nbsp; &nbsp; });<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sharing-buttons&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>In the code above, we&#8217;re calling the function <code class="codecolorer text geshi"><span class="text">get_social</span></code> using jQuery&#8217;s <a href="http://api.jquery.com/ready/">window load</a> function instead of the typical document ready &#8211; this makes means our function is called after everything has loaded, whereas document ready loads all code immediately after the DOM is ready.  Inside the window load event, we call our function and pass the title and permalink so our buttons have access to it.</p>
<p>In the <code class="codecolorer text geshi"><span class="text">get_social</span></code> function itself, we can use jQuery&#8217;s load function to pass our variables, get the response and populate or <code class="codecolorer text geshi"><span class="text">div</span></code> (with the id of &#8220;sharing-buttons&#8221;).  Please be sure to point to the correct URL of your share.php file (which we&#8217;ll create next) &#8211; you may even want to use the absolute URL to minimize errors (ie http://&#8230;).</p>
<h3>share.php</h3>
<p>The <code class="codecolorer text geshi"><span class="text">share.php</span></code> simply contains all of your dynamic button code.  Here&#8217;s what mine looks like:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;?php</span><br />
<span style="color: #009900;">&nbsp; &nbsp; $permalink <span style="color: #66cc66;">=</span> $_GET<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'permalink'</span><span style="color: #66cc66;">&#93;</span> ? $_GET<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'permalink'</span><span style="color: #66cc66;">&#93;</span> : $_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'permalink'</span><span style="color: #66cc66;">&#93;</span>;</span><br />
<span style="color: #009900;">&nbsp; &nbsp; $title <span style="color: #66cc66;">=</span> $_GET<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'title'</span><span style="color: #66cc66;">&#93;</span> ? $_GET<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'title'</span><span style="color: #66cc66;">&#93;</span> : $_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'title'</span><span style="color: #66cc66;">&#93;</span>;</span><br />
<span style="color: #009900;">?&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;digg&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; (function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.type = 'text/javascript';<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.async = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.src = 'http://widgets.digg.com/buttons.js';<br />
&nbsp; &nbsp; &nbsp; &nbsp; s1.parentNode.insertBefore(s, s1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; })();<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;DiggThisButton DiggMedium&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-share&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb_share&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box_count&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.facebook.com/sharer.php&quot;</span>&gt;</span>Share<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://static.ak.fbcdn.net/connect.php/js/FB.Share&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tweet&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://twitter.com/share&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter-share-button&quot;</span> data-count<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;vertical&quot;</span> data-via<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ThinkDevGrow&quot;</span>&gt;</span>Tweet<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://platform.twitter.com/widgets.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>In the beginning, I grab the permalink and title variables from either <code class="codecolorer text geshi"><span class="text">$_GET</span></code> or <code class="codecolorer text geshi"><span class="text">$_POST</span></code> (a bit more future-proof in case our function changes) and use the default button codes provided by these services.  Note that I don&#8217;t use the permalink or title in any of the above buttons, as these services automatically detect that information from whatever page they&#8217;re posted on, however it&#8217;s there if you need it!</p>
<p>That should be it though &#8211; if you edited your <code class="codecolorer text geshi"><span class="text">single.php</span></code> and correctly point to your <code class="codecolorer text geshi"><span class="text">share.php</span></code> file in the <code class="codecolorer text geshi"><span class="text">get_social</span></code> function, you should be loading your buttons after the rest of the page is completely loaded!</p>
<h2>See It In Action</h2>
<p>The current DevGrow theme (v3) is using this code in every post.  To see it, go to any article posted on this site and immediately scroll to the &#8216;Share this Article&#8217; section.  You should just see the small icons (RSS, email, reddit, etc.) until the entire page has finished loading, after which 3 additional buttons (Digg, Facebook and Twitter) should pop up above it.  If you take too long to scroll there you may end up missing it but keep an eye on your status bar &#8211; you should see the buttons loaded only after the rest of the page has finished loading.</p>
<h2>Caveats and Conclusion</h2>
<p>While working on this, I found that <strong>some buttons did not function correctly when loaded this way</strong>, such as the one for <a href="http://www.dzone.com/links/index.html">DZone</a>.  I didn&#8217;t spend too much time trying to figure out why but I assume it has to do with the way their button code extracts the host URL, which it may have had difficulty with since it was being loaded from an external file.  While it would&#8217;ve been nice to include that button, I found that having a faster loading site is much more important to me than any single service.</p>
<p>Also, please keep in mind that this won&#8217;t really change your overall page loading times &#8211; it will only make it so that the rest of the site is loaded before the social media buttons.  It&#8217;s useful if you find these buttons to be slow at times and parts of your page render white/blank until they&#8217;re finished loading, which is the issue I was having.</p>
<p>Are any of you doing something similar to this in order to load your content a little faster?  Anyone know why the DZone button isn&#8217;t working or know how to fix it?</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=2146&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/loading-social-media-buttons-after-everything-else/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Web Development on Windows 7: Essential Applications</title>
		<link>http://devgrow.com/web-development-on-windows-7-essential-applications/</link>
		<comments>http://devgrow.com/web-development-on-windows-7-essential-applications/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 14:38:09 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[essential applications]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=2012</guid>
		<description><![CDATA[As I mentioned in my last post, I&#8217;ve been asked for specific information on how I work. Having a solid work environment can go a long way in increasing your efficiency and help you stay organized, so today we&#8217;ll take a look at the setup of my desktop computer. The majority of my web design [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my <a href="http://devgrow.com/how-i-create-websites-a-look-inside-the-creative-process/">last post</a>, I&#8217;ve been asked for specific information on how I work.  Having a solid work environment can go a long way in increasing your efficiency and help you stay organized, so today we&#8217;ll take a look at the setup of my desktop computer.<span id="more-2012"></span></p>
<p>The majority of my web design and development work is done on a 64-bit Windows 7 desktop.  For more serious programming projects (pretty much any language other than PHP, HTML or CSS), I do switch over to Ubuntu in VMware Workstation, but nearly all of my web design client work is done in Windows.  From my experience so far, Windows 7 has been absolutely stellar for web development &#8211; it&#8217;s easy to use, fast and just plain works.</p>
<h2>Using the Right Software</h2>
<p>The key to working in any OS is using the right tools to make your work process as painless and efficient as possible.  Thankfully for Windows users, there are plenty of great tools available for web design and development.</p>
<h3><a href="http://notepad-plus-plus.org/">Notepad++</a></h3>
<p><a href="http://notepad-plus-plus.org/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/notepad.gif" alt="" title="Notepad++" width="600" height="200" class="aligncenter size-full wp-image-2020" /></a><br />
This is probably the best text editor available on Windows and best of all, it&#8217;s completely open source.  Notepad++ supports custom styles, recognizes a multitude of different programming languages and supports third-party plugins.  For my setup, I use a slightly modified Ruby Blue style/theme and the following plugins:</p>
<ul>
<li><a href="http://sourceforge.net/projects/npp-plugins/">Explorer</a> &#8211; Adds a file browser in a pane to the left or right of your editing screen, giving you quick access to your project files</li>
<li><a href="http://code.google.com/p/zen-coding/downloads/detail?name=Zen.Coding-Notepad%2B%2B.v0.6.1.zip&#038;can=2&#038;q=">Zen-Coding (Python-based)</a> &#8211; If you don&#8217;t know what Zen Coding is, just <a href="http://vimeo.com/7405114">watch the video</a>.  It will change the way you write web pages!</li>
</ul>
<p>There are a few more installed but these are the two I really can&#8217;t live without.  I&#8217;m still new to Zen Coding but so far it&#8217;s been an incredible experience, I highly recommend it!</p>
<h3><a href="http://www.adobe.com/products/photoshop/compare/">Adobe Photoshop and Illustrator CS5</a></h3>
<p><a href="http://www.adobe.com/products/photoshop/compare/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/photoshop.gif" alt="" title="Adobe Photoshop" width="600" height="200" class="aligncenter size-full wp-image-2021" /></a><br />
These are two tools that are an absolute necessity for serious designers and web devs.  I use Photoshop for rough mockups and full compositions before translating them into HTML/CSS in Notepad++.  Illustrator is a vector-based drawing tool that is critical for logo design, as you typically want to create something that is scalable without a loss in quality.</p>
<p>For Photoshop CS5, I use the Essentials workspace setting with a few customizations, including having the info panel show by default (very useful for sizing elements).  Unlike other developers, I prefer making my mockups to nearly exact scale.  It takes a bit longer to do but I like having an accurate depiction of my design and element placement before coding it out.  My rulers are (of course) set to pixels and my default document size is 1280px by 840px, which happens to fit perfectly in my 1680px by 1050px desktop resolution (no scrolling required even with side panels displayed).</p>
<h3><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTY + Pageant</a></h3>
<p><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/putty1.gif" alt="" title="PuTTY" width="600" height="200" class="aligncenter size-full wp-image-2025" /></a><br />
PuTTY is an open source SSH program that just works.  It&#8217;s dead simple to use and allows you to save profiles to easily connect to your frequently used servers.  Pageant comes with the default PuTTY installation and allows you to load/use SSH public or private keys (required for using Git).</p>
<h3><a href="http://code.google.com/p/tortoisegit/">TortoiseGit</a></h3>
<p><a href="http://code.google.com/p/tortoisegit/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/tortoisegit.gif" alt="" title="TortoiseGit" width="600" height="200" class="aligncenter size-full wp-image-2023" /></a><br />
Git is a version control system made famous by <a href="http://www.github.com/">Github</a>, which provides hosting and a plethora of other goodies for your Git projects.  I use Git for all of my bigger projects as it makes a) provides an additional level of data security/redundancy and b) makes deploying new code pretty painless (at least for smaller PHP projects).</p>
<h3><a href="http://winscp.net/eng/index.php">WinSCP</a></h3>
<p><a href="http://winscp.net/eng/index.php"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/winscp.gif" alt="" title="WinSCP" width="600" height="200" class="aligncenter size-full wp-image-2024" /></a><br />
WinSCP is an open source SFTP, FTP and SCP client for Windows.  It&#8217;s free, secure and easy to use &#8211; what more could you ask from an FTP client?  </p>
<h3>Firefox, Chrome, IE8, Safari and Opera</h3>
<p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/browsers.gif" alt="" title="Multiple Browsers" width="600" height="200" class="aligncenter size-full wp-image-2016" /><br />
These are all of the browsers I use on nearly every client project.  I use Chrome as my primary browser and debug my HTML/CSS using the <a href="http://webkit.org/blog/197/web-inspector-redesign/">WebKit Web Inspector</a> (inspect element) it comes with.  I&#8217;ll also debug in Firefox using Firebug from time to time, however most layouts that work in Chrome will also work in Firefox.  As the project progresses, I&#8217;ll check the layout in IE8, Safari and Opera from time to time to make sure the majority of users will have a similar experience.  I try to avoid IE7 and below if at all possible, though I will break them out if the client&#8217;s market demands it.</p>
<h3><a href="http://www.dexpot.de/index.php?lang=en">Dexpot</a></h3>
<p><a href="http://www.dexpot.de/index.php?lang=en"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/dexpot.gif" alt="" title="Dexpot" width="600" height="200" class="aligncenter size-full wp-image-2019" /></a><br />
One thing Ubuntu and OSX have that I sorely miss in Windows is the ability to have multiple desktops.  Thankfully, there are third-party applications like Dexpot to help rectify this &#8211; use this free software to add multiple desktops and an Exposé-like feature to Windows.</p>
<h3><a href="http://www.apachefriends.org/en/xampp-windows.html">XAMPP Lite</a></h3>
<p><a href="http://www.apachefriends.org/en/xampp-windows.html"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/xampp.gif" alt="" title="XAMPP Lite" width="600" height="200" class="aligncenter size-full wp-image-2019" /></a><br />
XAMPP Lite is a quick and easy way to get Apache and MySQL (with PHPMyAdmin) running on Windows.  This is a critical tool to develop and test web applications locally, as it makes the setup and installation of the most common web environment nearly effortless.</p>
<h3>Rainmeter, Desktop Gadgets and Sticky Notes</h3>
<p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/11/desktop.jpg" alt="" title="Desktop Apps" width="600" height="200" class="aligncenter size-full wp-image-2018" /><br />
The last few applications are not critical but do help with organization and maintaining your system:</p>
<ul>
<li><a href="http://rainmeter.net/RainCMS/">Rainmeter</a> &#8211; Provides incredible skinning options and widgets to your Windows desktop (<a href="http://customize.org/rainmeter">check out the skins</a>)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd834142.aspx">Windows Desktop Gadgets</a> &#8211; More widgets for your desktop (I only use two, one for weather and a CPU monitor)</li>
<li><a href="http://windows.microsoft.com/en-US/windows7/products/features/sticky-notes">Sticky Notes</a> &#8211; Included in Windows 7 (under Accessories), this is a great application for writing down quick notes and tasks that sits on the desktop</li>
</ul>
<h2>Conclusion</h2>
<p>That wraps up the list of essential applications I use on a daily basis on my Windows 7 desktop.  For more programming-heavy projects using RoR or Django, or based on NGINX or Lighttpd web environments, I prefer using the latest stable Ubuntu in VMware Workstation.  Prior to selling my laptop, I used a 15&#8243; Macbook Pro for travel and for iOS development (and I&#8217;m planning on purchasing another one in January).</p>
<h5>What is your ideal web development environment?  Do you have any other applications you recommend?</h5>
<p>Also, please remember to <a href="http://feeds.feedburner.com/devgrow">Subscribe to the RSS Feed</a> and <a href="http://twitter.com/ThinkDevGrow">Follow me on Twitter</a>!</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=2012&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/web-development-on-windows-7-essential-applications/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Mobile Web Development Part 2: Creating a Simple App Using jQuery Mobile</title>
		<link>http://devgrow.com/mobile-web-dev-using-jquery-mobile/</link>
		<comments>http://devgrow.com/mobile-web-dev-using-jquery-mobile/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 18:53:53 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=1924</guid>
		<description><![CDATA[This past weekend, John Resig (creator of jQuery) announced the release of the alpha version of jQuery Mobile, a simple and lightweight JavaScript framework for mobile web development. In this article, we&#8217;ll take a look at how easy it is to create a simple mobile website using framework, complete with dynamic (AJAX) page loading, iOS-style [...]]]></description>
			<content:encoded><![CDATA[<p>This past weekend, John Resig (creator of jQuery) announced the release of the alpha version of <a href="http://jquerymobile.com/">jQuery Mobile</a>, a simple and lightweight JavaScript framework for mobile web development.  In this article, we&#8217;ll take a look at how easy it is to create a simple mobile website using framework, complete with dynamic (AJAX) page loading, iOS-style design and slick page transitions.<span id="more-1924"></span></p>
<h2>Download</h2>
<p><center><a href="http://devgrow.com/examples/jquerymobile/jquerymobile.zip" class="download-button">Download Example (zip)</a><a href="http://devgrow.com/examples/jquerymobile/" class="download-button" style="margin-left:20px;">View Online</a></center></p>
<p><a href="http://devgrow.com/examples/jquerymobile/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/10/mobile-dev2-screenshot.png" alt="" title="jQuery Mobile Example" width="600" height="285" class="aligncenter size-full wp-image-1829" /></a></p>
<h2>How to Use jQuery Mobile</h2>
<p>jQuery Mobile is incredibly easy to use, just include the jQuery Mobile files in your header and add a few <code class="codecolorer text geshi"><span class="text">data</span></code> attributes to your markup and you&#8217;re set.  All of the styling is handled by jQuery and the included CSS file, so you can literally create a complete mobile webpage in minutes.  In the example below, we&#8217;ll create a simple page that loads internal links using a variety of transition effects.  The first few steps will outline the generic usage of jQuery Mobile while the rest will take a look at the specific elements used in the demo.</p>
<h5>Step 1. Include the jQuery Mobile Files in Header</h5>
<p>This step is pretty self-explanatory: just include the framework files.  You can download them from the jQuery Mobile site or load the files directly from their site/CDN, which will reduce bandwidth costs and keep your website speedy.</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> &nbsp;<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://code.jquery.com/jquery-1.4.3.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h5>Step 2. Use data attribute in HTML markup</h5>
<p>Apply <code class="codecolorer text geshi"><span class="text">data</span></code> attribute tags to your HTML, where <em>n</em> is the available feature you want to set, for example:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span> data-theme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;b&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span> data-theme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;b&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>My Site<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> data-theme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span> data-dividertheme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;a&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>Transition Effects<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=slide&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide&quot;</span>&gt;</span>Slide<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=slideup&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slideup&quot;</span>&gt;</span>Slide Up<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=slidedown&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slidedown&quot;</span>&gt;</span>Slide Down<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=pop&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pop&quot;</span>&gt;</span>Pop<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=flip&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flip&quot;</span>&gt;</span>Flip<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;effects.php?id=fade&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fade&quot;</span>&gt;</span>Fade<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">br</span></a> <span style="color: #66cc66;">/</span>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">br</span></a> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-dividertheme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>Seamless List (margin-less)<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide&quot;</span>&gt;</span>Example Item 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide&quot;</span>&gt;</span>Example Item 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-transition<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide&quot;</span>&gt;</span>Example Item 3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span> data-position<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fixed&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><span style="color: #ddbb00;">&amp;copy;</span> Copyright Info or Site URL<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>The <code class="codecolorer text geshi"><span class="text">data-role</span></code> element specifies which DIV/block should be used for the header, footer and content, all of which are inside the main <em>page</em> wrapper.  Here are the <code class="codecolorer text geshi"><span class="text">data</span></code> attributes used in this example:</p>
<ul>
<li><strong>data-role</strong> &#8211; specifies the nature of the wrapper element, can be set to: <em>page</em>, <em>header</em>, <em>content</em>, <em>footer</em>.  Two other settings were used in the example to indicate list elements and list dividers, for which the attribute was set to: <em>listview</em> for the main list element and <em>list-divider</em> for the list divider.  There are a few other available settings, including <em>collapsible</em>, which creates a collapsible/show-hide block (<a href="http://jquerymobile.com/demos/1.0a1/#docs/content/content-collapsible.html">more info</a>).</li>
<li><strong>data-position</strong> &#8211; specifies whether the element should be <em>fixed</em>, in which case it will render at the top (for header) or bottom (for footer)</li>
<li><strong>data-inset</strong> &#8211; specifies whether element should be within content margins or outside of it (flush or with margin) &#8211; set to <em>true</em> or <em>false</em></li>
<li><strong>data-transition</strong> &#8211; specifies which transition to use when loading new pages, can be set to: <em>slide</em>, <em>slideup</em>, <em>slidedown</em>, <em>pop</em>, <em>flip</em> or <em>fade</em></li>
<li><strong>data-theme</strong> &#8211; specifies which design theme to use for elements within container, can be set to: <em>a</em>, <em>b</em>, <em>c</em>, <em>d</em>, <em>e</em></li>
<li><strong>data-dividertheme</strong> &#8211; specifies the theme for the list dividers using same options as <strong>data-theme</strong></li>
</ul>
<h5>Step 3. Add content and publish online!</h5>
<p>Using the above example, the <a href="http://jquerymobile.com/demos/1.0a1/#docs/pages/docs-pages.html">template found on jQueryMobile.com</a> or creating your own layout, populate the blocks with your own content and upload the files.  Currently, jQuery Mobile renders the pages the same on mobile and desktop browsers, so you don&#8217;t necessarily need a smartphone to test it out (though having one can help ironing out bugs).</p>
<h2>Accessibility and Precautions</h2>
<p>Right now, the alpha version of jQuery Mobile (the only one currently available) is compatible with all versions of Safari for iOS and for most browsers on Android.  BlackBerry is partially supported and Windows Mobile is sketchy at best, but rest assured that compatibility will only get better with time, as that is the main goal of jQuery Mobile &#8211; creating a widely compatible mobile JavaScript framework.  You can view the <a href="http://jquerymobile.com/gbs/">compatibility chart</a> on the official site but should also <a href="http://jquerymobile.com/blog/">follow their blog</a> to get the latest updates too.</p>
<p>That said, is it worth investing the time and energy to use jQuery Mobile over the other available mobile frameworks, even though it&#8217;s in the alpha development phase right now?  I would say <strong>yes, absolutely</strong> &#8211; this is a framework that has huge momentum behind it right now and will only get better with time.  As long as you&#8217;re staying on top of updates and changes, you should definitely start getting familiar with this framework if you&#8217;re planning on doing some mobile-friendly web development.</p>
<p>An additional benefit of jQuery Mobile is that it makes loading pages using AJAX automatic.  Add an <a href="http://www.askdavetaylor.com/how_to_create_custom_apple_iphone_website_icon.html">iPhone home screen icon</a> to your application and iOS will cleverly hide Safari controls, mimicking native applications.</p>
<h2>About the Example</h2>
<p>The downloadable example above includes is split into a header and footer file for the sake of convenience, feel free to use whatever coding method you prefer.  I may end up creating a simple MVC framework using jQuery Mobile that makes it easier to develop a dynamic mobile app, in which case I&#8217;ll be sure to post it on this blog.  If you&#8217;d be interested in something like that, leave a comment below and I&#8217;ll try to bump up it&#8217;s priority on my huge list of to-dos.</p>
<p><strong>Edit:</strong> The first iteration of the <a href="http://devgrow.com/jquery-mobile-php-mvc-framework/">jQuery Mobile PHP/MVC Framework</a> is complete.</p>
<h2>Conclusion</h2>
<p>That wraps it up for part 2 of the Mobile Web Development series.  Be sure to check out part 1, an <a href="http://devgrow.com/intro-to-mobile-web-dev/">Introduction to Mobile Web Development</a>, if you missed it earlier.  In the next part, we&#8217;ll take a look at the various other mobile web frameworks out there, so stay tuned!</p>
<p><strong>Also a reminder:</strong> the <a href="http://devgrow.com/appsumo-giveaway/">AppSumo giveaway contest</a> ends tomorrow &#8211; be sure to <a href="http://devgrow.com/appsumo-giveaway/">check out the details</a> and enter (it takes 30 seconds and is free), you could win nearly $400 worth of support products.</p>
<p>And as always, <a href="http://feeds.feedburner.com/devgrow">subscribe to our RSS feed</a> and <a href="http://twitter.com/ThinkDevGrow">follow us on Twitter</a> if you haven&#8217;t already!</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=1924&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/mobile-web-dev-using-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>Creating a Simple, Reusable PHP Cache Class</title>
		<link>http://devgrow.com/simple-cache-class/</link>
		<comments>http://devgrow.com/simple-cache-class/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 15:45:35 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=1861</guid>
		<description><![CDATA[Recently for a small project, I turned one of my previous WordPress cache experiments into a simple, reusable PHP class that you can throw into any project for quick caching. It&#8217;s released under MIT license so feel free to use and modify it however you&#8217;d like! Download The following zip file contains the PHP class [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for a small project, I turned one of my previous <a href="http://www.hongkiat.com/blog/display-wordpress-sidebar-on-other-non-wp-sites/">WordPress cache experiments</a> into a simple, reusable PHP class that you can throw into any project for quick caching.  It&#8217;s released under MIT license so feel free to use and modify it however you&#8217;d like!<span id="more-1861"></span></p>
<h2>Download</h2>
<p>The following zip file contains the PHP class and license information.</p>
<div class="downloadBox"><a href="http://devgrow.com/examples/SimpleCache.zip" class="button download">Download Source File (zip)</a></div>
<h3>The Cache Class</h3>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">class</span> Cache <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Pages you do not want to Cache:</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$doNotCache</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;admin&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;profile&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// General Config Vars</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheDir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;./cache&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheTime</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">21600</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$caching</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheFile</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheFileName</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheLogFile</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cacheLog</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFile</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/base64_encode"><span style="color: #990000;">base64_encode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFileName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheDir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFile</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.txt'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheDir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/log.txt&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheDir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <a href="http://www.php.net/mkdir"><span style="color: #990000;">mkdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheDir</span><span style="color: #339933;">,</span> <span style="color: #208080;">0755</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_slice"><span style="color: #990000;">array_slice</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doNotCache</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFileName</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <a href="http://www.php.net/filemtime"><span style="color: #990000;">filemtime</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFileName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheTime</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFile</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">caching</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFileName</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">caching</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> <a href="http://www.php.net/end"><span style="color: #990000;">end</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">caching</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file_put_contents"><span style="color: #990000;">file_put_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFileName</span><span style="color: #339933;">,</span><a href="http://www.php.net/ob_get_contents"><span style="color: #990000;">ob_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/ob_end_flush"><span style="color: #990000;">ob_end_flush</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheFile</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_put_contents"><span style="color: #990000;">file_put_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #339933;">,</span><a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> purge<span style="color: #009900;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/base64_encode"><span style="color: #990000;">base64_encode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_put_contents"><span style="color: #990000;">file_put_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #339933;">,</span><a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> purge_all<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_put_contents"><span style="color: #990000;">file_put_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLogFile</span><span style="color: #339933;">,</span><a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cacheLog</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>All of the functions are fairly self-explanatory.  The <code class="codecolorer text geshi"><span class="text">__construct</span></code> function is called when you instantiate the class &#8211; all it does is set the variables and create (or load) the cache log file.  I chose to use a log file to deal with cache creation and deletion as it reduces unnecessary calls and is a bit faster, in my opinion.  If you&#8217;d rather just delete expired files, feel free to change that section to however you see fit.</p>
<p>The <code class="codecolorer text geshi"><span class="text">start</span></code> function first checks the current URL to make sure that the base name is not in the &#8220;do not cache&#8221; list and either <strong>a)</strong> begins the cache process or <strong>b)</strong> loads the existing cache.  The <code class="codecolorer text geshi"><span class="text">end</span></code> function checks to see whether or not the page is being cached and if so, creates the static file and updates the cache log file.</p>
<p>The last two functions are used for deleting cache files.  The <code class="codecolorer text geshi"><span class="text">purge</span></code> function takes a location (full URL for now) and marks it for deletion, while the <code class="codecolorer text geshi"><span class="text">purge_all</span></code> function marks all files for deletion.  When a file is marked for deletion, the next time a user visits that page the script will create a fresh cache file (it will not be deleted in advance, simply overwritten).</p>
<h3>How to Use the Cache Class</h3>
<p>Using the cache class is very easy!  Just call the <code class="codecolorer text geshi"><span class="text">start</span></code> function at the part of your script where you&#8217;d like to start caching and the <code class="codecolorer text geshi"><span class="text">end</span></code> function wherever the cache ends.  For me personally, I tend to start caching after the header section (where I have dynamic elements, such as username and profile links) and end caching after the footer.  I also make use of the <code class="codecolorer text geshi"><span class="text">doNotCache</span></code> array to make sure my admin and profile pages are not cached.  Lastly, I add the <code class="codecolorer text geshi"><span class="text">purge_all</span></code> function to my admin save function, so that whenever I update the site the cache is cleared.</p>
<p><strong>To start the Cache:</strong></p>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cache.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$cache</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Cache<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Start caching (if needed)</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Other PHP that generates your pages goes here</span></div></td></tr></tbody></table></div>
<p><strong>And to end the Cache:</strong></p>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><a href="http://www.php.net/end"><span style="color: #990000;">end</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Stop caching</span></div></td></tr></tbody></table></div>
<p>Anything outside of the <code class="codecolorer text geshi"><span class="text">start</span></code> and <code class="codecolorer text geshi"><span class="text">end</span></code> functions are left alone, so be sure to cache wisely.</p>
<h3>Conclusion</h3>
<p>I wrote this class after having the need for really simple caching that didn&#8217;t require a bunch of other libraries to use.  If this is useful for your project, I&#8217;d love to hear about it in the comments (it would make my day), and I really appreciate any feedback you may have!  I know my PHP isn&#8217;t pro level (probably not even close) but I hope it&#8217;s good enough to use in small projects.</p>
<p>Lastly, if you haven&#8217;t subscribed to the <a href="http://feeds.feedburner.com/devgrow">RSS feed</a>, please consider doing so to get more posts like this, and <a href="http://twitter.com/ThinkDevGrow">follow me on Twitter</a>!</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=1861&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/simple-cache-class/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Top 10 Essential WordPress Plugins</title>
		<link>http://devgrow.com/top-10-essential-wordpress-plugins/</link>
		<comments>http://devgrow.com/top-10-essential-wordpress-plugins/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 17:56:50 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=1837</guid>
		<description><![CDATA[After reading about Jason Cohen&#8217;s latest startup, I started thinking about the plugins I install in every WordPress blog I run and what I recommend to my clients. Below are a list of my must-have plugins for pretty much any blog, take a look: 1. W3 Total Cache This is perhaps the most critical plugin [...]]]></description>
			<content:encoded><![CDATA[<p>After reading about Jason Cohen&#8217;s <a href="http://blog.asmartbear.com/nut-up-or-shut-up.html">latest startup</a>, I started thinking about the plugins I install in every WordPress blog I run and what I recommend to my clients.  Below are a list of my must-have plugins for pretty much any blog, take a look:<span id="more-1837"></span></p>
<div class="gray-line"></div>
<h3>1. <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a></h3>
<p><a href="http://wordpress.org/extend/plugins/w3-total-cache/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/w3tc.gif" alt="" title="W3 Total Cache" width="150" height="150" class="alignright size-full wp-image-1847" /></a><br />
This is perhaps the most critical plugin for any blog that gets a decent amount of traffic.  W3 Total Cache (W3TC) allows you to:</p>
<ul>
<li>Cache your pages so they load much faster (not dynamically generated)</li>
<li>Minify and compress your HTML, JavaScript and CSS files</li>
<li>Use a Content Delivery Network (CDN) to quickly serve static media files from multiple subdomains</li>
</ul>
<p>All of these features serve one purpose: to reduce page load times.  Check any <a href="http://www.techcrunch.com/">popular</a> <a href="http://www.mashable.com/">blog</a> <a href="http://www.smashingmagazine.com/">running</a> WordPress and there&#8217;s a pretty good chance they are using W3TC (or their own custom caching solution).</p>
<div class="gray-line"></div>
<h3>2. <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All-in-One SEO</a></h3>
<p><a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/all-in-one-seo.gif" alt="" title="all-in-one-seo" width="150" height="150" class="alignright size-full wp-image-1841" /></a><br />
Search Engine Optimization (SEO) are a set of practices and techniques that help your website rank better in search engines, which in turn generates more traffic.  The All-in-One SEO plugin makes your blog a little more SEO-friendly by allowing you to customize titles, keywords and descriptions (META data) for the overall blog and for each post.</p>
<p><strong>Honorable Mention:</strong> <a href="http://techblissonline.com/platinum-seo-pack/">Platinum SEO Pack</a> &#8211; I&#8217;ve been told this is just as good (if not better) than All-in-One SEO Pack, however I have not tested it yet personally.</p>
<div class="gray-line"></div>
<h3>3. <a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a></h3>
<p><a href="http://wordpress.org/extend/plugins/contact-form-7/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/contact-form-7.gif" alt="" title="contact-form-7" width="150" height="150" class="alignright size-full wp-image-1842" /></a><br />
Ever wanted an elegant, AJAX-powered contact form for your blog?  Contact Form 7 makes it super simple to get one up and running within minutes, just customize the form in the administration panel and paste the code in any page or post.</p>
<p>My favorite part about this plugin is that you can create multiple custom forms and do so very quickly using their intuitive backend interface, it&#8217;s simple but very effective.</p>
<div class="gray-line"></div>
<h3>4. <a href="http://wordpress.org/extend/plugins/wp-greet-box/">WP Greet Box</a></h3>
<p><a href="http://wordpress.org/extend/plugins/wp-greet-box/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/wp-greet-box.gif" alt="" title="wp-greet-box" width="150" height="150" class="alignright size-full wp-image-1848" /></a><br />
I&#8217;ve just recently installed this plugin (I know, I&#8217;m late!) but it&#8217;s easily part of the essential plugins list.  WP Greet Box displays a custom greeting for users that arrive to your blog posts from a recognized referrer, such as Google, Digg or Reddit.  The default install includes greetings for over 30 popular services however you can also add a custom greeting for any referring URL manually.</p>
<p>If you&#8217;d like to test this out, search for &#8216;SliderNav&#8217; on Google and the first result should be a jQuery plugin I wrote a while back.  Clicking on it will take you to the post but soon after you should see a box appear under the title that has a Google logo, a link to my RSS feed and the option to display a few other related posts.  Very useful for keeping users engaged!</p>
<div class="gray-line"></div>
<h3>5. <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin</a> (YARPP)</h3>
<p><a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/related-posts.gif" alt="" title="related-posts" width="150" height="150" class="alignright size-full wp-image-1845" /></a><br />
At the bottom of every post I write, you&#8217;ll find a list of related posts.  This is courtesy of YARPP, a related posts plugin with a high level of customization and display options.  In my opinion, you should always try to have a list of related posts immediately after your post, as it will help increase user engagement and strengthen your readership, and this plugin makes it easy to do exactly that.</p>
<div class="gray-line"></div>
<h3>6. <a href="http://wordpress.org/extend/plugins/subscribe-to-comments/">Subscribe to Comments</a></h3>
<p><a href="http://wordpress.org/extend/plugins/subscribe-to-comments/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/subscribe-to-comments.gif" alt="" title="subscribe-to-comments" width="150" height="150" class="alignright size-full wp-image-1846" /></a><br />
In my opinion, WordPress should integrate this feature into the core &#8211; it&#8217;s a simple addition that can have a meaningful impact on reader discussions.  Subscribe to Comments adds a checkbox beneath your comment form that if checked will send an e-mail notification each time someone comments on the post.  It&#8217;s especially useful for posts in which the reader expects the author to respond or wants to follow an active/heated discussion.</p>
<div class="gray-line"></div>
<h3>7. <a href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/">Google Analytics for WordPress</a></h3>
<p><a href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/google-analytics.gif" alt="" title="google-analytics" width="150" height="150" class="alignright size-full wp-image-1843" /></a><br />
As the name suggests, this plugin by <a href="http://yoast.com/">Yoast</a> allows you to add <a href="http://www.google.com/analytics/">Google Analytics</a> code to your blog.  You may be thinking &#8216;well, I can easily do that by editing my theme templates!&#8217; and you would be correct.  However, you&#8217;d have to edit every theme you use with your personalized analytics code and that can be pretty annoying.  It makes much more sense to use a plugin that allows you to embed any analytics code on any theme without having to manually change files &#8211; this keeps things organized, systematic and efficient.</p>
<div class="gray-line"></div>
<h3>8. <a href="http://wordpress.org/extend/plugins/popularity-contest/">Popularity Contest</a></h3>
<p><a href="http://wordpress.org/extend/plugins/popularity-contest/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/popularity.gif" alt="" title="popularity" width="150" height="150" class="alignright size-full wp-image-1844" /></a><br />
Alex King&#8217;s Popularity Contest is by far the best plugin to determine which posts and pages are popular based on a number of customizable criteria, including views (from multiple sources), comments, pings and trackbacks.  It also provides a customizable function to display your popular posts in whatever format you&#8217;d like.</p>
<p>You can see the plugin in action in the sidebar to the right, under Popular Articles.</p>
<div class="gray-line"></div>
<h3>9. <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Google XML Sitemaps</a></h3>
<p><a href="http://wordpress.org/extend/plugins/google-sitemap-generator/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/xml-sitemaps.gif" alt="" title="xml-sitemaps" width="150" height="150" class="alignright size-full wp-image-1849" /></a><br />
As I mentioned in a <a href="http://devgrow.com/quick-seo-tip-2-submit-your-sitemap/">previous post</a>, submitting your XML Sitemap to Google can be crucial in improving the number of pages indexed by the search engine.  Unfortunately, WordPress doesn&#8217;t generate an XML sitemap by default.  Thankfully, there are multiple plugins available that take care of this (of which I prefer this one).</p>
<div class="gray-line"></div>
<h3>10. <a href="http://wordpress.org/extend/plugins/akismet">Akismet</a></h3>
<p><a href="http://wordpress.org/extend/plugins/akismet"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/09/akismet.gif" alt="" title="akismet" width="150" height="150" class="alignright size-full wp-image-1840" /></a><br />
This isn&#8217;t higher up on the list because this plugin is included by default in every WordPress install.  If you haven&#8217;t used or activated it yet, stop whatever you&#8217;re doing and make it your first priority to do so.  Even on a fairly small blog like this one, Akismet has prevented more than 2000 spammy comments from being posted.  It is by far the most useful WordPress plugin, hence it&#8217;s inclusion with the core package.</p>
<div class="gray-line"></div>
<h3>Parting Thoughts</h3>
<p>Since I use these plugins in just about every WordPress install I do, it would be nice to have a plugin that downloads and installs them in one shot.  Does anyone know of a plugin that does this?  If not, it seems like it could be very popular, at least in the web design/development circle.</p>
<h5>Are there any other plugins you consider essential?  Share them in the comments! </h5>
<img src="http://devgrow.com/?ak_action=api_record_view&id=1837&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/top-10-essential-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Complete Guide to Creating Your First Website</title>
		<link>http://devgrow.com/complete-guide-to-creating-your-first-website/</link>
		<comments>http://devgrow.com/complete-guide-to-creating-your-first-website/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 02:45:15 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=1546</guid>
		<description><![CDATA[So one thing is clear: you want/need your own website.  But how do you go about making one?  Where do you even start?  Whether it's for your business, personal blog or any obscure reason, understanding how the web works and establishing an online presence is crucial in today's high-tech world.]]></description>
			<content:encoded><![CDATA[<p class="note">This article is aimed at the completely inexperienced, those who may have always wanted a website but do not yet understand what it takes to make one.</p>
<p>So one thing is clear: you want/need your own website.  But how do you go about making one?  Where do you even start?  Whether it&#8217;s for your business, personal blog or any obscure reason, understanding how the web works and establishing an online presence is crucial in today&#8217;s high-tech world.<span id="more-1546"></span></p>
<h2>Understanding the Web and How Websites Work</h2>
<p>According to Wikipedia, a website can be defined as a &#8220;collection of related web pages, images, videos or other digital assets that are addressed relative to a common Uniform Resource Locator (URL).&#8221;  Simply put, it&#8217;s a collection of internet-accessible files stored somewhere and identified by an URL/address.  Let&#8217;s take a look at some more definitions first:</p>
<ul>
<li><strong>HTML</strong> &#8211; HyperText Markup Language, the name of the syntax/code used to create web page files (usually ending in .html)</li>
<li><strong>Host</strong> &#8211; A host makes your files accessible on the web by storing your files on a server/computer and providing a persistent internet connection</li>
<li><strong>Web Server</strong> &#8211; The actual machine or piece of hardware where your files are stored (usually by your host)</li>
<li><strong>IP Address</strong> &#8211; The numerical address of your Web Server; All computers connected to the internet have an IP address, even yours</li>
<li><strong>Domain Name</strong> &#8211; The actual address of the website, ie www.mydomain.com</li>
<li><strong>Registrar</strong> &#8211; The company that has permission from <a href="http://www.icann.org/">ICANN</a> to sell domain names, like <a href="http://www.godaddy.com/">GoDaddy</a></li>
<li><strong>DNS</strong> &#8211; Domain Name Servers, used to connect a domain name to a host/server</li>
</ul>
<p>Now that we have a basic understand of the terms involved, let&#8217;s take a look at how they are connected.  A website is a collection of <strong>HTML</strong> files and digital assets (images, scripts, videos, etc.) stored on a <strong>web server</strong> (provided by a <strong>host</strong>) that makes it accessible by anyone via a persistent internet connection.  How do you find that website?  Using a <strong>domain name</strong>, which is the online address of your website.  The domain name is purchased from a domain <strong>registrar</strong> and before it can be used, it must point to the correct <strong>domain name servers</strong> that correctly directs traffic to your web server&#8217;s <strong>IP address</strong>.  It may sound a bit convoluted at first but thinking about it in simpler terms might help to better grasp the concept:<br />
<img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/internet-diagram.gif" alt="" title="Diagram of How Website&#039;s Work" width="600" height="250" class="aligncenter size-full wp-image-1552" /><br />
In the above diagram, the green arrow represents the request you make when you enter a URL into your browser and the blue arrow represents the response sent back.  What&#8217;s important to note is that many hosts offer all of these services, so from one server you can get hosting (web server access) for your files and complete domain name setup.</p>
<h5>Further Reading:</h5>
<ol>
<li><a href="http://en.wikipedia.org/wiki/Website">Wikipedia Article on Websites</a></li>
<li><a href="http://www.howstuffworks.com/web-page.htm">HowStuffWorks: How Web Pages Work</a></li>
<li><a href="http://www.quackit.com/how-websites-work/">How Websites Work by Quackit</a></li>
</ol>
<h2>Creating Your First Website</h2>
<p>Now that you have an understanding of how websites work, it&#8217;s time to create your first web page.  The below steps will take you through the entire process, from picking a domain name to uploading your files.</p>
<h5>1. Picking the Right Host</h5>
<p><a href="http://mediatemple.net/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/mt.gif" alt="" title="Media Temple" width="100" height="100" class="alignright size-full wp-image-1560" /></a>This can be a bit complicated depending on your needs but for nearly all starters, a simple shared hosting plan is enough to host a basic website.  I suggest <a href="http://mediatemple.net/webhosting/gs/">Media Temple&#8217;s Grid Service</a> to most of my clients and <a href="http://devgrow.com/hostgator">Host Gator</a> to those feeling a little cheaper.  Both providers have been around for a long time and are fairly consistent in their services.</p>
<h5>2. Getting a Domain Name</h5>
<p><a href="http://www.godaddy.com/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/godadddy.gif" alt="" title="GoDaddy" width="100" height="100" class="alignright size-full wp-image-1559" /></a>There are many providers that offer domain names for a variety of prices.  In reality, they are all resellers for ICANN and whoever sells the most can usually offer the cheapest prices.  Personally I use <a href="http://www.godaddy.com/">GoDaddy</a> because they are one of the cheapest (use CHRIS3 coupon during checkout for $7.95 domains) but their website feels a bit spammy.  Throughout the entire purchasing process, they&#8217;ll suggest purchasing a million of their other services (including hosting) but I would personally advise against those.</p>
<h5>3. Configuring Your DNS</h5>
<p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/nameserver.gif" alt="" title="Configure DNS" width="100" height="100" class="alignright size-full wp-image-1561" />When you register for your domain name, you&#8217;re given the option to edit it&#8217;s DNS information.  If you skip this, you can find it (at least in GoDaddy) under Manage Domains by checking the relevant domain name and selecting Set Nameservers from the top menu.  Enter the addresses of the DNS servers your host provided when you signed up with them to let GoDaddy know where to send visitors when they enter your URL.</p>
<h5>4. Creating a Basic Web Page</h5>
<p>As I mentioned earlier, HTML provides the backbone for web pages.  In fact, you can right-click on any website and click View Source to see the HTML code that is powering the site.  While it may look daunting at first, HTML is not really that complex and can be learned within a few days with some patience.  On your desktop, create a blank file and call it <code class="codecolorer text geshi"><span class="text">index.html</span></code>, then enter the following HTML into it:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span>My Website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span>Hello World<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>The above code will produce this, a simple white page with the words &#8216;Hello Word&#8217; written on it.  HTML is all about tags that must be opened and closed.  Every page should have a <code class="codecolorer html4strict geshi"><span class="html4strict">head</span></code> section with a proper <code class="codecolorer html4strict geshi"><span class="html4strict">title</span></code>, this is the text that is visible in the title bar of your browser.  The <code class="codecolorer html4strict geshi"><span class="html4strict">body</span></code> section is where any content you want shown on the website itself should go &#8211; in this example we have a simple paragraph (<code class="codecolorer html4strict geshi"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span></span></code>) with that contains the &#8216;Hello World&#8217; statement.  Also note that each tag must be closed properly and in the correct order.</p>
<h5>5. Upload and Sit Back</h5>
<p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/upload.gif" alt="" title="Upload" width="100" height="100" class="alignright size-full wp-image-1562" />Now that you have your first web page ready, you need to get it online by uploading the file to your web server.  This is done using an FTP, or File Transfer Protocol, program like <a href="http://filezilla-project.org/">FileZilla</a> (OS-independent) or <a href="http://winscp.net/eng/index.php">WinSCP</a> (Windows only).  When you signed up for your host, you should have received an e-mail that contains an FTP address, usually <em>ftp.mydomain.com</em>, and some login credentials.  Start the FTP program, enter your credentials and transfer the <code class="codecolorer text geshi"><span class="text">index.html</span></code> file from your computer to the <em>public_html</em> folder (or sometimes www) on your web server.</p>
<h5>Congratulations! Your Website is Now Online</h5>
<p>If you have properly configured your host, purchased a domain name and set your DNS information, entering your URL into a browser should load up your Hello World page.</p>
<h2>Make it Better With Open Source Software</h2>
<p>The example above is too simple for any practical use and chances are, you want something that looks nice and has more functionality.  While I would definitely recommend learning as much about building websites as you can first, there are a few ways to get a nice website up very quickly and with limited knowledge.  Open source software makes this possible, there are literally hundreds of blogging platforms and content management systems that you can install to have a very complete website running in minutes.</p>
<p>Most of these scripts require the minimum of PHP and MySQL, both of are included in 99% of shared hosting services.  Create a database, upload the script and point your browser to the install file, the rest is taken care of automatically.  The best part is that open source software is completely free to use, so definitely check it out.</p>
<h5>A Few Open Source Options:</h5>
<ol>
<li><a href="http://wordpress.org/">WordPress Blogging Software</a></li>
<li><a href="http://www.phpbb.com/">phpBB Forum Software</a></li>
<li><a href="http://www.madebyfrog.com/">FrogCMS Content Management System</a></li>
</ol>
<h2>Conclusion</h2>
<p>This article is meant to be a very basic introduction into the very big world of web development.  It&#8217;s meant for my friends who have always expressed interest in creating a website but don&#8217;t have the time to invest in learning to make one.  Feedback is appreciated and comments are always welcome!</p>
<p>Also remember to <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS Feed</a> and follow <a href="http://twitter.com/ThinkDevGrow">@ThinkDevGrow</a> on Twitter!</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=1546&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/complete-guide-to-creating-your-first-website/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Quick and Simple PHP Honey Pot Spam Prevention</title>
		<link>http://devgrow.com/simple-php-honey-pot/</link>
		<comments>http://devgrow.com/simple-php-honey-pot/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 22:20:11 +0000</pubDate>
		<dc:creator>Monjurul Dolon</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[honey pot]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devgrow.com/?p=1369</guid>
		<description><![CDATA[A honey pot trap involves creating a form with an extra field that is hidden to human visitors but readable by robots.  The robot fills out the invisible field and submits the form, leaving you to simply ignore their spammy submission or blacklist their IP.  It's a very simple concept that can be implemented in a few minutes and it just works - add them to your contact and submission forms to help reduce spam.]]></description>
			<content:encoded><![CDATA[<p>This technique has been floating around the web for the past few weeks so it&#8217;s definitely worth sharing here.  Using standard HTML, CSS and a little PHP, you can filter out a lot of robots and spammers that crawl the web for unsuspecting forms.  Credit to <a href="http://www.aaronjamesyoung.com/">Aaron James Young</a> for reminding me about this technique (he posted a similar snippet on <a href="http://forrst.com/">Forrst</a>).</p>
<p>A honey pot trap involves creating a form with an extra field that is hidden to human visitors but readable by robots.  The robot fills out the invisible field and submits the form, leaving you to simply ignore their spammy submission or blacklist their IP.  It&#8217;s a very simple concept that can be implemented in a few minutes and it just works &#8211; add them to your contact and submission forms to help reduce spam.  I&#8217;ve used them extensively in my last few projects, I&#8217;ve found it to be well worth the small time investment.</p>
<h2>Contact Form Example</h2>
<p>Here is an example of a simple contact form that uses the honey pot spam prevention method:<br />
<center><a href="http://devgrow.com/examples/honeypot/" class="download-button view">View Example</a><a href="http://devgrow.com/examples/honeypot/honeypot.zip" class="download-button" style="margin-left:20px;">Download Source</a></center></p>
<h3>The HTML:</h3>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">fieldset</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">legend</span></a>&gt;</span>Contact Me<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">legend</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Name:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>E-mail:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Message:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- The following field is for robots only, invisible to humans: --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotic&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pot&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>If you're human leave this blank:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Send Message&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">fieldset</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></td></tr></tbody></table></div>
<h3>The PHP:</h3>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'your-email-here@gmail.com'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Contact Form Submission'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$from_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$from_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$robotest</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'robotest'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$robotest</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are a gutless robot.&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$from_name</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$from_email</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$header</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$from_name</span> &lt;<span style="color: #006699; font-weight: bold;">$from_email</span>&gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$success</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are human and your message was sent!&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are human but there was a problem sending the e-mail.&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;All fields are required.&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg error&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$error</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$success</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg success&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$success</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>The CSS:</h3>
<div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #6666ff;">.robotic</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>In the above example link, I added some optional CSS to make it look a little nicer.  Also, you&#8217;ll notice the actual e-mail form doesn&#8217;t work, as the to e-mail address is a fake one.  The contact form part is just to illustrate the honey pot, the important thing to notice is that the last text field is hidden using CSS (the entire paragraph) and that if text is entered in the field, the entire form fails.</p>
<h2>Conclusion</h2>
<p>This concept is certainly not my own and in fact, there is even an entire project dedicated to catching spammers using dummy forms and blacklisting their IP addresses (rightfully called <a href="http://www.projecthoneypot.org/">Project Honey Pot</a>).  Again thanks to <a href="http://www.aaronjamesyoung.com/">Aaron</a> for reminding me about this technique, I&#8217;ve been meaning to do a write up on it for a while now.  This post is also thanks to <a href="http://forrst.com/">Forrst</a>, I&#8217;m quite pleasantly surprised at the amount of interesting information I&#8217;m finding there.</p>
<img src="http://devgrow.com/?ak_action=api_record_view&id=1369&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://devgrow.com/simple-php-honey-pot/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 27/63 queries in 0.029 seconds using apc
Object Caching 2282/2388 objects using apc
Content Delivery Network via cdn.devgrow.com

Served from: devgrow.com @ 2012-02-04 07:58:33 -->
