<?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>Best Practices &#187; Web Development</title>
	<atom:link href="http://www.indywebshop.com/bestpractices/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indywebshop.com/bestpractices</link>
	<description>presented by Site Potion</description>
	<lastBuildDate>Sun, 12 Apr 2009 12:27:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Window&#8217;s Host File Gives You Your Own Personal DNS Settings</title>
		<link>http://www.indywebshop.com/bestpractices/2009/04/12/windows-host-file-gives-you-your-own-personal-dns-settings/</link>
		<comments>http://www.indywebshop.com/bestpractices/2009/04/12/windows-host-file-gives-you-your-own-personal-dns-settings/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 12:27:59 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/?p=389</guid>
		<description><![CDATA[So here&#8217;s a useful trick I was reminded of this past week.
Sometimes as a developer I write code that appears on multiple web sites. I just write a few lines that check what domain name the current site is using and execute the relevant code appropriately. Confusing? Think about when you sign up for an [...]]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s a useful trick I was reminded of this past week.</p>
<p>Sometimes as a developer I write code that appears on multiple web sites. I just write a few lines that check what domain name the current site is using and execute the relevant code appropriately. Confusing? Think about when you sign up for an account at Wordpress.com. You have a blog at <em>yourusername</em>.wordpress.com. Everyone&#8217;s different blogs are all pointing to the same code, but different database records are pulled based on the domain name being used.</p>
<p>The inconvenience here as a developer is when you need to test what you&#8217;ve written with a particular domain. You can update the DNS to point to your server, but if there&#8217;s a problem then the whole world is going to be looking at the broken site. You need to see it, though, so you can fix it.</p>
<p><span id="more-389"></span>There&#8217;s a file on Windows computer that for all practical purposes lets you create your own personal DNS settings that only affect your machine. It&#8217;s called the hosts file. On a default XP or Vista installation, it&#8217;s located at C:\WINDOWS\system32\drivers\etc\hosts.</p>
<p>Interesting bit of trivia, this file is where the value for <em>localhost</em> is set.</p>
<p>For my purposes, though, I can use this file to point a domain name to a test server and verify exactly how a site is going to work <strong>before</strong> I change any DNS values.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2009/04/12/windows-host-file-gives-you-your-own-personal-dns-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broken Apostrophes When Querying Wordpress Tables</title>
		<link>http://www.indywebshop.com/bestpractices/2009/03/25/broken-apostrophes-when-querying-wordpress-tables/</link>
		<comments>http://www.indywebshop.com/bestpractices/2009/03/25/broken-apostrophes-when-querying-wordpress-tables/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 02:05:45 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apostrophe]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/?p=385</guid>
		<description><![CDATA[I&#8217;m a big fan of the Wordpress blogging platform, and it&#8217;s the one I use when I&#8217;m setting my clients up with a blog.  In most cases they want Wordpress to be a small part of their site instead of the whole thing.  (You can certainly make a case for Wordpress as a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of the Wordpress blogging platform, and it&#8217;s the one I use when I&#8217;m setting my clients up with a blog.  In most cases they want Wordpress to be a small part of their site instead of the whole thing.  (You can certainly make a case for Wordpress as a full CMS, but let&#8217;s just focus on the clients who want to add a blog to their existing site.)  It&#8217;s pretty easy to create a custom theme that matches their site.  Copy the header.  Copy the footer.  Make some tweaks to style.css in the custom theme, and you&#8217;re golden.  Until you try to link from the home page to a blog post with an apostrophe in the title.</p>
<p><span id="more-385"></span>If a client really understands the purpose and power of a blog, they probably won&#8217;t be content to just bury the blog on some back corner of their site.  They&#8217;re going to want the latest headlines to show up on the home page.  I can roll up my sleeves and write an old fashioned SQL query to pull from the Wordpress tables.  In my test cases, everything works beautifully.</p>
<p>What I didn&#8217;t realize is that none of my test cases had apostrophes in the title.  Once my client would add a post with an apostrophe, though, the headline on the home page showed a broken special character symbol.  On the Wordpress pages everything looked fine.</p>
<p>The problem has to do with character encoding.  Simple enough.  I made changes in my HTML tags to use UTF8 encoding &#8211; just like Wordpress uses.  That should do the trick, right?  Nope.  What I finally learned is that the query I was pulling out of MySQL wasn&#8217;t UTF8 encoded.  So the information I was getting already had broken characters before the encoding that I set in HTML was applied.</p>
<p>It&#8217;s a little confusing.  (Heck I&#8217;m not sure I entirely understand.)  But here&#8217;s the important part:  If you&#8217;re getting broken apostrophes when you pull information out of a Wordpress table, include this line right after you call mysql_connect().</p>
<blockquote><p>mysql_query(&#8220;SET NAMES &#8216;utf8&#8242;&#8221;);</p></blockquote>
<p>That&#8217;s what did the trick for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2009/03/25/broken-apostrophes-when-querying-wordpress-tables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making Your CSS Files Dynamic With a Little PHP</title>
		<link>http://www.indywebshop.com/bestpractices/2009/03/19/making-your-css-files-dynamic-with-a-little-php/</link>
		<comments>http://www.indywebshop.com/bestpractices/2009/03/19/making-your-css-files-dynamic-with-a-little-php/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 19:36:17 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css variables]]></category>
		<category><![CDATA[dynamic css]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/?p=376</guid>
		<description><![CDATA[I&#8217;ve grown so accustomed to writing in languages like PHP where I can use variables, loops, and arrays to cut down on the amount of duplicate code I need to create.  I love the flexibility I had to make things as efficient and modular as possible.  So I used to dread working with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve grown so accustomed to writing in languages like PHP where I can use variables, loops, and arrays to cut down on the amount of duplicate code I need to create.  I love the flexibility I had to make things as efficient and modular as possible.  So I used to dread working with a CSS file.  CSS is a huge step up from the days of inline styling, but I wanted more.  If I was slightly changing the shade of green on the site, I wanted to change it in one place and have it update anywhere.</p>
<p>This is possible (and even easy) with a little PHP. </p>
<p><span id="more-376"></span>Here&#8217;s what the line in your header tag is going to look like:</p>
<blockquote><p>&lt;link type=&#8221;text/css&#8221; rel=&#8221;stylesheet&#8221; href=&#8221;style.css.php&#8221; /&gt;</p></blockquote>
<p>Now if you treat style.css.php as a typical CSS file, it&#8217;s not quite going to work.  You need a little extra bit of code at the top, to make sure the web browser treats this as css.</p>
<blockquote><p>&lt;? header(&#8220;Content-type: text/css&#8221;); ?&gt;</p></blockquote>
<p>With that in place, your in business.  You can use variables just like you would in any other css document.</p>
<blockquote><p>&lt;? $blue = &#8216;#003366;&#8217; ?&gt;<br />
body { background-color: &lt;?= $blue ?&gt;; }<br />
h1 { color: &lt;?= $blue ?&gt;; } </p></blockquote>
<p>You can also pass variables.  Remember the line of code you had back in your HTML file?  What if it looked like this?</p>
<blockquote><p>&lt;link type=&#8221;text/css&#8221; rel=&#8221;stylesheet&#8221; href=&#8221;style.css.php?theme=green&#8221; /&gt;</p></blockquote>
<p>Now you can do some cool tricks in your CSS file:</p>
<blockquote><p>&lt;?<br />
if($theme == &#8216;blue&#8217;) { $maincolor = &#8216;#003366; }<br />
if($theme == &#8216;green&#8217;) { $maincolor = &#8216;#339966&#8242;; }<br />
?&gt;<br />
body { background-color: &lt;?= $maincolor ?&gt;; }<br />
h1 { color: &lt;?= $maincolor ?&gt;; }</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2009/03/19/making-your-css-files-dynamic-with-a-little-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Communicate Hosting Requirements at the Outset</title>
		<link>http://www.indywebshop.com/bestpractices/2008/09/17/communicate-hosting-requirements-at-the-outset/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/09/17/communicate-hosting-requirements-at-the-outset/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:00:12 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Dealing With Clients]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/?p=348</guid>
		<description><![CDATA[
 photo credit: fill3r
With most of my clients, I develop their site on my web server.  We&#8217;ll go back and forth through all the iterations of changes there.  When it&#8217;s complete, then I move it over to their production server.  95% of the time, this works fine.  I recently came across [...]]]></description>
			<content:encoded><![CDATA[<p style="float: left; margin: 0 15px 15px 0;"><a title="bofhcam" href="http://www.flickr.com/photos/45725034@N00/26608943/" target="_blank"><img src="http://farm1.static.flickr.com/23/26608943_0b4e490f5b_m.jpg" border="0" alt="bofhcam" /></a><br />
<small><a title="Attribution-ShareAlike License" href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank"><img src="http://www.indywebshop.com/bestpractices/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absMiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="fill3r" href="http://www.flickr.com/photos/45725034@N00/26608943/" target="_blank">fill3r</a></small></p>
<p>With most of my clients, I develop their site on my web server.  We&#8217;ll go back and forth through all the iterations of changes there.  When it&#8217;s complete, then I move it over to their production server.  95% of the time, this works fine.  I recently came across a situation, though, where a client had their website hosted with a company that did not support <a href="http://www.mysql.com/">MySQL</a> (my database of choice).  Since I had built a CMS for them, this was a problem.</p>
<p><span id="more-348"></span></p>
<p>Everything was eventually worked out, but it did require some emails and phone calls back and forth to get to a resolution.  The process of moving the finished site from the development server to the production server normally takes just a few hours, but in this case it took <strong>more than a week</strong>.</p>
<p>In hindsight, I could have easily gotten the ball rolling on verifying that MySQL would be available at the beginning of the development process.  Then these issues could have been taken care of at the same time the programming and design was happening.  It just didn&#8217;t occur to me because how often do you run into a situation where a web host doesn&#8217;t have MySQL already implemented?  For two years it had never been an issue, but in the past few weeks it has come up <strong><em>three</em></strong> times.  Most large hosting companies provide packages with MySQL, but some of the local hosting providers here in Indianapolis don&#8217;t.</p>
<p>The solution to avoid this in the future is to make sure that I include in my original quote that the site will need to run on a server that has PHP and MySQL.  I did this when I first started my business, but kind of got out of the habit because it just didn&#8217;t seem to be necessary.  If I start applying that practice again consistently with every customer, that will get the conversation about hosting requirements started.  My customers (and I) won&#8217;t have any unpleasant surprises when it comes time to go live with the site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/09/17/communicate-hosting-requirements-at-the-outset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightbox and Other Modal Overlay Effects</title>
		<link>http://www.indywebshop.com/bestpractices/2008/09/03/lightbox-and-other-modal-overlay-effects/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/09/03/lightbox-and-other-modal-overlay-effects/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 14:00:07 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/?p=344</guid>
		<description><![CDATA[
Hot on the heels of (and sometimes built upon) incredibly useful Javascript libraries like Scriptaculous, there&#8217;s been a wave of modal overlay effects.  (Some of the most popular are listed here.)  They all seem to have their own unique quirks, but the overlying theme is the same.  A small layer is given [...]]]></description>
			<content:encoded><![CDATA[<p style="float: left; margin: 0 15px 15px 0;"><a href="http://www.indywebshop.com/bestpractices/wp-content/uploads/2008/09/cap.jpg"><img class="alignnone size-medium wp-image-346" title="Example of Modal Overlay" src="http://www.indywebshop.com/bestpractices/wp-content/uploads/2008/09/cap-150x127.jpg" border="0" alt="" width="150" height="127" /></a></p>
<p>Hot on the heels of (and sometimes built upon) incredibly useful Javascript libraries like Scriptaculous, there&#8217;s been a wave of modal overlay effects.  (Some of the most popular are listed <a href="http://www.zimbio.com/Interesting++webthings/articles/97/Web+2+0+Round+up+Modal+Window+Lightbox+Effect">here</a>.)  They all seem to have their own unique quirks, but the overlying theme is the same.  A small layer is given attention by bringing it to the front and graying out everything behind it.  Functionally it accomplishes some of the same things as a popup window without needing to open a separate window.</p>
<p><span id="more-344"></span></p>
<p><a href="http://www.azarask.in/blog/post/designing-without-modal-overlays/">Not everyone</a> is a fan of the modal overlay, but for the most part the web design community seems to be embracing them.  <em>[azarask.in via </em><a href="http://www.37signals.com/svn/posts/1149-modal-overlays-beyond-the-dialog-box"><em>37signals</em></a><em>]</em>  They definitely add to the elusive <strong>cool factor</strong> of a website without a great deal of programming work required.  You simply download one of the libraries and configure it.</p>
<p>If cool was all that was provided, I&#8217;m not sure I would really like them.  I really dig them, though, because I consider them to be a <strong>UI upgrade</strong>.  It&#8217;s important when designing a website to clearly communicate to the visitor what they should be focusing on and how they can interact with it.  Modals are a perfect fit for this.  Graying out the background information makes it immediately obvious where the action is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/09/03/lightbox-and-other-modal-overlay-effects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft Spell-Check Tells Me Eyestrain Is One Word</title>
		<link>http://www.indywebshop.com/bestpractices/2008/03/19/microsoft-spell-check-tells-me-eyestrain-is-one-word/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/03/19/microsoft-spell-check-tells-me-eyestrain-is-one-word/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 14:00:13 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/2008/03/19/microsoft-spell-check-tells-me-eyestrain-is-one-word/</guid>
		<description><![CDATA[
I went to bed last night with a killer headache centered right behind my eyes. Perhaps I shouldn’t have been surprised since I had spent almost every waking hour of the past 4 days staring into my monitor as though it displayed the secret of eternal happiness and life everlasting. (It doesn’t.) The reason I’ve [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>I went to bed last night with a killer headache centered right behind my eyes. Perhaps I shouldn’t have been surprised since I had spent almost every waking hour of the past 4 days staring into my monitor as though it displayed the secret of eternal happiness and life everlasting. (It doesn’t.) The reason I’ve been going overboard is that I’m very excited about the overhaul I’m giving my facetious movie review site. I’ll post more about that in a few weeks (update: the new version of <a href="http://www.singlesentence.com">Single Sentence Movie Review</a> is live), but now I want to talk about the research I did this morning on ways to prevent eyestrain.</p>
<p><span id="more-304"></span></p>
<p>Sadly I didn’t turn up any new information that I didn’t already know about. I set my <a href="http://www.lockergnome.com/windows/2006/06/07/adjust-your-monitors-refresh-rate/">monitor refresh rate</a> as high as my system will allow. The process prompted me to update my video card driver, which is good, but I’m still only humming along at a very modest 70 Hertz. I guess it doesn’t really matter since I have an LCD monitor that doesn’t flicker anyway, but it seems like I might have some psychological comfort if I could jack the refresh rate up into the triple-digits.</p>
<p>Since I use Windows XP, I also went through the steps of recalibrating my <a href="http://en.wikipedia.org/wiki/ClearType">ClearType</a> settings. I honestly don’t notice any difference.</p>
<p>Those are the only technical configuration steps I found. I suppose the only perfect solution is to take frequent breaks to give my eyes a chance to rest. Many times this weekend, though, I would just get in a groove where hours slipped by without me even noticing.</p>
<p>Anyone else have any suggestions of things I should be doing to avoid eyestrain?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/03/19/microsoft-spell-check-tells-me-eyestrain-is-one-word/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Offer Email Templates as an Ancillary Service</title>
		<link>http://www.indywebshop.com/bestpractices/2008/03/12/offer-email-templates-as-an-ancillary-service/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/03/12/offer-email-templates-as-an-ancillary-service/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 14:00:45 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Finding Work]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/2008/03/12/offer-email-templates-as-an-ancillary-service/</guid>
		<description><![CDATA[
As a web developer you have the necessary set of skills to create HTML email formats. I was never that crazy about them because creating a design that will be effective in all major email clients is even more taxing than creating one for the major web browsers. You really have to keep the styling [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>As a web developer you have the necessary set of skills to create HTML email formats. I was never that crazy about them because creating a design that will be effective in all major email clients is even more taxing than creating one for the major web browsers. You really have to keep the styling pretty vanilla.</p>
<p><span id="more-303"></span></p>
<p>But some business owners (particularly those with a marketing budget) love having a branded look-and-feel for their email messages. Sometimes they just want all of their outgoing messages to have a unique look. The first time you build a custom stationary in Outlook it may take a while to learn what you’re doing, but you get the hang of it pretty quickly.</p>
<p>Maybe they have higher aspirations for a monthly email newsletter that needs to have a more complex layout. Steer them towards <a href="http://www.constantcontact.com/">Constant Contact</a> or <a href="http://www.exacttarget.com">Exact Target</a> and create a personal template just for them. These third party email campaign managers even have a lot of cool features already built in that could help you close a sale.</p>
<p>I don’t like doing email templates as much as I like building web sites, but it&#8217;s still a heck of a lot more fun than flipping burgers. When there&#8217;s nothing on your plate this might be a good way to bring in a trickle of income and build relationships with business that could lead to larger projects down the road.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/03/12/offer-email-templates-as-an-ancillary-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in Debugging CakePHP</title>
		<link>http://www.indywebshop.com/bestpractices/2008/02/06/adventures-in-debugging-cakephp/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/02/06/adventures-in-debugging-cakephp/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 14:00:17 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/2008/02/06/adventures-in-debugging-cakephp/</guid>
		<description><![CDATA[
The purpose of this blog is to share whatever wisdom I accumulate in my business with other freelance web developers. Normally that means looking back at my previous week and trying to identify what I wish someone had told me at the beginning of the week. I generalize that information so that it will be [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>The purpose of this blog is to share whatever wisdom I accumulate in my business with other freelance web developers. Normally that means looking back at my previous week and trying to identify what I wish someone had told me at the beginning of the week. I generalize that information so that it will be useful to a wider range of people. With this post, however, I feel the need to be extremely specific.</p>
<p><span id="more-294"></span></p>
<p>I’ve been using <a href="http://www.cakephp.org/">CakePHP</a> as the coding framework for most of my development for close to a year now. I’m a big fan. Once I got over the learning curve involved with adapting any new coding practice, using Cake really cut down on my development and maintenance time… until last Friday, the first day of February, in this the 2008th year of our Lord.</p>
<p>I had finished a site and was moving it over from my development server to the production server. I had to do a few tweaks to the .htaccess files since the production server was on <a href="http://www.godaddy.com">GoDaddy</a>. The changes are minor and easy to <a href="http://www.google.com/search?sourceid=navclient&amp;aq=t&amp;ie=UTF-8&amp;rlz=1T4DMUS_enUS225US225&amp;q=cakephp+godaddy">find information on</a>. Once I had that up and running, the site was working smoothly. I should say it was running smoothly on some pages, but other pages were showing a not found error. (For Cake aficionados: two of my controllers were showing the not found error, but the other controllers were fine.)</p>
<p>I spent two hours trying to figure out what the problem was. I searched on the Internet. I made experimental changes to files that were part of the Cake framework. I laid my head down on my desk and questioned why I ever got into web design in the first place.</p>
<p>The solution was simple, even if not obvious. It’s very easy to understand why no one has posted on the Internet about this problem before. What are the odds that someone would do the exact sequence of events that I did that led up to this problem? The URL that was failing was www.examplesite.com/products . The problem was caused by a file that I had in the web root named products.php.</p>
<p>This didn’t cause an issue on my development server, but as I understand it GoDaddy handles mod_rewrite (used by Cake) a little differently than most web hosts. The file was in the web root because before I ever start doing any hardcore programming, I create a simple mock-up for the client to approve. On this site I had multiple screens to mock-up (one of which I named products.php).</p>
<p>The odds of someone running into this same problem seems pretty low to me. (My totally made-up estimate is it could happen to 1 out of every 30,000 CakePHP users.) Just in case, though, I want to make sure that they find this page if it will possibly save them the frustration that I experienced on Friday. That’s why I’m mentioning some of the terms that I typed in when I was trying to solve this mystery:</p>
<p>cakephp &#8220;The requested address&#8221; &#8220;was not found on this server&#8221;<br />
cakephp controller not found<br />
cakephp some controllers not found<br />
cakephp 404 not found<br />
cakephp htaccess<br />
cakephp godaddy install</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/02/06/adventures-in-debugging-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leveraging Fresh, Original Content</title>
		<link>http://www.indywebshop.com/bestpractices/2008/01/17/leveraging-fresh-original-content/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/01/17/leveraging-fresh-original-content/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 21:03:52 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Dealing With Clients]]></category>
		<category><![CDATA[Finding Work]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/2008/01/17/leveraging-fresh-original-content/</guid>
		<description><![CDATA[
One of the most difficult and valuable things to create on a web site is original content that is regularly updated. You can design a stylized layout that will draw visitors in, but if there isn&#8217;t relevant content that is regularly updated, visitors aren&#8217;t going to stay long. Yet most business owners did not start [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>One of the most difficult and valuable things to create on a web site is original content that is regularly updated. You can design a stylized layout that will draw visitors in, but if there isn&#8217;t relevant content that is regularly updated, visitors aren&#8217;t going to stay long. Yet most business owners did not start their business with the intent of becoming web authors. So most are resistant to the idea of committing to the ongoing task of creating content for the site. After all, how are they supposed to find time for that in the midst of running a business?</p>
<p><span id="more-290"></span></p>
<p>For the few clients you work with who do decide they are willing to write regularly, you can help them get the most out of that effort. The word blog gets thrown around a lot today, but what is it really? It&#8217;s a just a series of dated articles. Those can be announcements, product updates, specials, or just about anything. It&#8217;s just words and sometimes pictures.</p>
<p>What&#8217;s a newsletter? It&#8217;s also words and pictures with a date attached. They just get emailed instead of sitting on a web page. If you&#8217;ve got a client that is willing to do either a newsletter or a blog, you can get more out of that original content by doing both. The hard part is already done. The client created the information. (<a href="http://www.indywebshop.com/bestpractices/2007/04/18/its-not-just-what-you-say/">Or paid someone else to write it.</a>) Providing another channel to disseminate that information is going to help them get the most benefit for the time invested.</p>
<p>It&#8217;s probably not the best idea to duplicate the content exactly. Maybe the newsletter just has a few lines and a link to the best blog posts that have been written recently. The point is to help your clients get original content out to their customers via as many channels as you can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/01/17/leveraging-fresh-original-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving an Uploaded File a Unique Name in PHP</title>
		<link>http://www.indywebshop.com/bestpractices/2008/01/10/giving-an-uploaded-file-a-unique-name-in-php/</link>
		<comments>http://www.indywebshop.com/bestpractices/2008/01/10/giving-an-uploaded-file-a-unique-name-in-php/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 15:00:04 +0000</pubDate>
		<dc:creator>Clay</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.indywebshop.com/bestpractices/2008/01/10/giving-an-uploaded-file-a-unique-name-in-php/</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve done a technical post with code snippets, so I thought I&#8217;d share a function that I use at least every week. The majority of my work is with custom CMS or the occasional intranet. In both cases I&#8217;m regularly dealing with code where the visitor can upload files to [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve done a technical post with code snippets, so I thought I&#8217;d share a function that I use at least every week. The majority of my work is with custom CMS or the occasional intranet. In both cases I&#8217;m regularly dealing with code where the visitor can upload files to the web site. Maybe it&#8217;s pictures or PDFs or something else entirely. In any case, I have a simple function that I use to make sure the filename is unique.</p>
<blockquote><p>function uniqueName($folderpath,$filename) {<br />
    $adjname = str_replace(&#8221; &#8220;,&#8221;_&#8221;,$filename);<br />
    $fulldest = $folderpath.$adjname;<br />
    $originaldest = $fulldest;<br />
    for ($i=1; file_exists($fulldest); $i++) {<br />
        $fulldest = str_replace(&#8220;.&#8221;,&#8221;$i.&#8221;,$originaldest);<br />
    }<br />
    return $fulldest;<br />
}</p></blockquote>
<p>If you tried to upload a file called <em>filename.jpg</em> to a directory where that name already exists, this function would return <em>filename1.jpg</em>.</p>
<p>Flaws: The immediate flaw that jumps out at me when I look at this function is that if someone had a filename with multiple periods, such as <em>my.precious.file.jpg</em>, the function would return <em>my1.precious1.file1.jpg</em>. Since the file names are usually just stored in a database for me, this hasn&#8217;t come up as a problem, but it&#8217;s something to be aware of.</p>
<p>Any readers our there want to offer their improved versions of this function?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.indywebshop.com/bestpractices/2008/01/10/giving-an-uploaded-file-a-unique-name-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
