<?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>Richard K Miller &#187; PHP</title>
	<atom:link href="http://richardkmiller.com/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://richardkmiller.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 15:26: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>What goes around, comes around</title>
		<link>http://richardkmiller.com/314/what-goes-around-comes-around</link>
		<comments>http://richardkmiller.com/314/what-goes-around-comes-around#comments</comments>
		<pubDate>Thu, 21 Feb 2008 05:57:05 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[mediawiki mod_auth_mysql jonudell]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2008/02/what-goes-around-comes-around</guid>
		<description><![CDATA[I&#8217;m not a big believer in karma, but this week I experienced some karma-like effects. Two years ago for work, I developed code to protect wiki websites. Then I published it on my blog. This weekend a software upgrade caused &#8230; <a href="http://richardkmiller.com/314/what-goes-around-comes-around">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-f1113d8105150d123c3a417f48973f5e57662a94'><p>I&#8217;m not a big believer in karma, but this week I experienced some karma-like effects. Two years ago for work, I developed code to <a href="http://www.richardkmiller.com/blog/archives/2006/05/password-protecting-mediawiki-with-mod_auth_mysql">protect wiki websites</a>. Then I published it on my blog.</p>
<p>This weekend a software upgrade caused this protection code to stop working on our websites. I couldn&#8217;t find an answer. Then yesterday, some chap named Nathan left a comment describing the <a href="http://www.richardkmiller.com/blog/archives/2006/05/password-protecting-mediawiki-with-mod_auth_mysql#comment-144444">solution</a>. I hadn&#8217;t asked for help. He was simply documenting his own experience. But it was just what I needed.</p>
<p>This is fundamental to open source software &#8212; the creation of a software commons. It&#8217;s also what happens on Wikipedia, the creation of a knowledge commons.</p>
<p>In <em>Love Is the Killer App</em>, Tim Sanders suggests freely sharing your knowledge and your network, not hoarding them.</p>
<p>Jon Udell talks of &#8220;narrating&#8221; one&#8217;s work from day to day. This allows everyone to share in your vast brain knowledge, and it becomes your living résumé. I&#8217;d like to do more of that.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/314/what-goes-around-comes-around/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Amtrak series: Ruby on Rails on Rails</title>
		<link>http://richardkmiller.com/273/amtrak-series-ruby-on-rails-on-rails</link>
		<comments>http://richardkmiller.com/273/amtrak-series-ruby-on-rails-on-rails#comments</comments>
		<pubDate>Thu, 07 Jun 2007 17:00:50 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Amtrak]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2007/06/amtrak-series-ruby-on-rails-on-rails</guid>
		<description><![CDATA[This will be the most technical of my posts in the Amtrak series, but it&#8217;s not just for computer geeks so stay with me. Here we go. Ruby on Rails is a &#8220;web application framework&#8221;, a way for programmers to &#8230; <a href="http://richardkmiller.com/273/amtrak-series-ruby-on-rails-on-rails">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-25ab5b4d4da0e906b96ef5184bc029a41a0bb498'><p>This will be the most technical of my posts in the Amtrak series, but it&#8217;s not just for computer geeks so stay with me. Here we go.</p>
<p><a href="http://www.rubyonrails.org/">Ruby on Rails</a> is a &#8220;web application framework&#8221;, a way for programmers to make web applications more easily and more quickly (and more enjoyably, as its creators would be quick to point out.) It was created by <a href="http://37signals.com/">37signals</a>, the makers of Basecamp and other fine web apps, and has been one of the fastest growing programming environments of the last couple years. &#8220;Ruby&#8221; is the programming language and &#8220;Rails&#8221; is the set of additions that make it &#8220;fast&#8221; and &#8220;easy,&#8221; like a high-speed train. (Not a <a href="http://www.richardkmiller.com/blog/archives/2007/06/amtrak-series-pictures">sight-seeing Amtrak</a>.)</p>
<p><a href='http://www.richardkmiller.com/blog/wp-content/uploads/2007/06/img_0088.jpg' title='img_0088.jpg' rel='lightbox'><img src='http://www.richardkmiller.com/blog/wp-content/uploads/2007/06/img_0088.thumbnail.jpg' alt='img_0088.jpg' style='float:right; margin:1em;' /></a></p>
<p>You probably see where this is going. As an exercise in literalness, I though it would be interesting to do a little Ruby on Rails programming while on the train, or in other words, Ruby on Rails on Rails. (Mitch Hedberg said &#8220;I&#8217;d like to see a forklift lift a crate of forks. It&#8217;d be so&#8230;literal. &#8216;Hey, you&#8217;re using that machine for its exact purpose!&#8217;&#8221;) See the pictures.</p>
<p>I have not delved into Rails as much as my local colleagues, but with the little I&#8217;ve used it, I&#8217;ve been impressed. By taking away the tedious parts of programming, it really does make programming more enjoyable. I know <a href="http://www.johntaber.com/">several</a> <a href="http://www.griffio.com/">good</a> <a href="http://www.apriux.com/">developers</a> who prefer it.</p>
<p>Ruby on Rails enforces an architecture called &#8220;Model-View-Controller&#8221; (MVC), which is used heavily in Mac applications and well written web applications. Though not built on Rails, <a href="http://wordpress.org/">WordPress</a> also uses an MVC architecture. If you have a WordPress blog, you know you can easily change the theme of your blog. This is thanks to the modular MVC architecture with which it was written.</p>
<p><a href='http://www.richardkmiller.com/blog/wp-content/uploads/2007/06/img_0096.jpg' title='img_0096.jpg' rel='lightbox'><img src='http://www.richardkmiller.com/blog/wp-content/uploads/2007/06/img_0096.thumbnail.jpg' alt='img_0096.jpg' style='float:right; margin:1em;' /></a></p>
<p>Here&#8217;s where this applies to everyone: 37signals hasn&#8217;t only extracted Rails from their best programming practices, they&#8217;ve also extracted a book from their best business practices. I highly recommend <a href="http://gettingreal.37signals.com/">Getting Real</a> by 37signals, availably entirely for free on their <a href="http://gettingreal.37signals.com/toc.php">website</a>. They&#8217;ve <a href="http://www.37signals.com/svn/posts/451-whats-your-cookbook">given away their &#8220;cookbook&#8221;</a> &#8212; what they&#8217;ve learned about marketing, project management, time management, hiring, agility, task prioritization, and more. I finished the book believing that small teams can do great things.</p>
<p style='clear:both;'>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/273/amtrak-series-ruby-on-rails-on-rails/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New version of Seth Godin WordPress plugin</title>
		<link>http://richardkmiller.com/262/new-version-of-seth-godin-wordpress-plugin</link>
		<comments>http://richardkmiller.com/262/new-version-of-seth-godin-wordpress-plugin#comments</comments>
		<pubDate>Tue, 15 May 2007 22:23:43 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2007/05/new-version-of-seth-godin-wordpress-plugin</guid>
		<description><![CDATA[Five months ago I created a WordPress plugin to implement a marketing principle taught by Seth Godin. He said good marketers &#8220;treat returning visitors differently than newbies&#8221;. The plugin has been one of the most popular features on my blog. &#8230; <a href="http://richardkmiller.com/262/new-version-of-seth-godin-wordpress-plugin">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-bca6788c85278fbe3d2ca906cf664248669f0942'><p>Five months ago I created a WordPress plugin to implement a marketing principle taught by Seth Godin. He said good marketers &#8220;treat returning visitors differently than newbies&#8221;. The plugin has been one of the <a href="http://technorati.com/search/www.richardkmiller.com%2Fblog%2Fwordpress-plugin-what-would-seth-godin-do%2F">most popular features on my blog</a>.</p>
<p>Today I upgraded the plugin to version 1.3, adding a feature that allows the welcome message to be displayed permanently if desired.</p>
<p>For more information, read about the <a href="http://www.richardkmiller.com/blog/wordpress-plugin-what-would-seth-godin-do/">What Would Seth Godin Do plugin for WordPress</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/262/new-version-of-seth-godin-wordpress-plugin/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>What Would Seth Godin Do</title>
		<link>http://richardkmiller.com/227/what-would-seth-godin-do</link>
		<comments>http://richardkmiller.com/227/what-would-seth-godin-do#comments</comments>
		<pubDate>Tue, 19 Dec 2006 20:46:57 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/12/what-would-seth-godin-do</guid>
		<description><![CDATA[If you&#8217;re a marketer or a WordPress user, you might like the WordPress plugin I recently created. Based on a principle taught by Seth Godin, it lets you treat new visitors to your site different from returning visitors: &#8220;What Would &#8230; <a href="http://richardkmiller.com/227/what-would-seth-godin-do">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-98548e61d51f29bbc2e71a2c68b05f2b5d3c9804'><p>If you&#8217;re a marketer or a WordPress user, you might like the WordPress plugin I recently created.  Based on a <a href="http://sethgodin.typepad.com/seths_blog/2006/08/in_the_middle_s.html">principle taught by Seth Godin</a>, it lets you treat new visitors to your site different from returning visitors:</p>
<p><a href="http://www.richardkmiller.com/blog/wordpress-plugin-what-would-seth-godin-do/">&#8220;What Would Seth Godin Do&#8221; WordPress plugin</a></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/227/what-would-seth-godin-do/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PHP 5 and Beyond</title>
		<link>http://richardkmiller.com/196/php-5-and-beyond</link>
		<comments>http://richardkmiller.com/196/php-5-and-beyond#comments</comments>
		<pubDate>Thu, 17 Aug 2006 05:34:28 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/08/php-5-and-beyond</guid>
		<description><![CDATA[I enjoy developing in PHP 5, for its improved object oriented design and XML support. PHP 6 is slated to have additional useful improvements like built-in Unicode, built-in caching, and increased security out of the box (no register_globals, magic_quotes, or &#8230; <a href="http://richardkmiller.com/196/php-5-and-beyond">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-627d4b6e70c1777f5c1b7a250cc84f441857ac11'><p>I enjoy developing in PHP 5, for its improved <a href="http://us3.php.net/oop5">object oriented design</a> and XML support.  <a href="http://www.php.net/~derick/meeting-notes.html">PHP 6</a> is slated to have additional useful improvements like built-in Unicode, built-in caching, and increased security out of the box (no register_globals, magic_quotes, or safe_mode).</p>
<p>Here are other improvements I&#8217;d like to see in a future version of PHP:</p>
<ul>
<li>while-else statement &#8212; A <a href="http://www.richardkmiller.com/blog/archives/2006/02/php-needs-a-while-else-statement">while-else statement</a> would be perfect for MySQL results: loop through the results, or if there were no results display an error.</li>
<li>a better toString() &#8212; The <a href="http://us3.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring">toString()</a> function lets you cast an object as a string, but in PHP it only works when directly combined with echo or print.  Dumb.</li>
<li>function overloading &#8212; Let the signature of the function call decide which definition to use.</li>
</ul>
<p>Read more about <a href="http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html">PHP 6</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/196/php-5-and-beyond/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Essential PHP Security</title>
		<link>http://richardkmiller.com/204/essential-php-security</link>
		<comments>http://richardkmiller.com/204/essential-php-security#comments</comments>
		<pubDate>Thu, 17 Aug 2006 04:38:58 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/08/essential-php-security</guid>
		<description><![CDATA[I recently finished reading Essential PHP Security by Chris Shiflett (O&#8217;Reilly). It was a good, quick read, and for me it was mostly a review of principles I had previously read on Chris&#8217;s blog. The main principles are filter input &#8230; <a href="http://richardkmiller.com/204/essential-php-security">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-d184839805672590166125424dca1d97a7f8ae53'><p>I recently finished reading <a href="http://www.amazon.com/gp/product/059600656X/">Essential PHP Security</a> by Chris Shiflett (O&#8217;Reilly).  It was a good, quick read, and for me it was mostly a review of principles I had previously read on <a href="http://shiflett.org/">Chris&#8217;s blog</a>. The main principles are <b>filter input</b> and <b>escape output</b>.  Using separate arrays for each kind of data is a best practice:</p>
<p><code><br />
// <b>filter input and assign it to the "$clean" array</b><br />
if (ctype_alnum($_POST['name']))<br />
    $clean['name'] = $_POST['name'];</p>
<p>// <b>escape HTML output with htmlentities()</b><br />
$html['name'] = htmlentities($clean['name'], ENT_QUOTES);<br />
echo "You entered the name $html[name].";</p>
<p>// <b>escape MySQL output with mysql_real_escape_string()</b><br />
$mysql['name'] = mysql_real_escape_string($clean['name']);<br />
mysql_query("INSERT INTO table (name) VALUES ('$mysql[name]')");<br />
</code></p>
<p>After reading the book I was only left with one question: is HTTP Authentication over SSL fairly secure?  (I assumed it would be.)  I emailed Chris with my question and he responded quickly in the affirmative.  Thanks, Chris.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/204/essential-php-security/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Best Practices</title>
		<link>http://richardkmiller.com/209/css-best-practices</link>
		<comments>http://richardkmiller.com/209/css-best-practices#comments</comments>
		<pubDate>Mon, 14 Aug 2006 17:25:02 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/08/css-best-practices</guid>
		<description><![CDATA[Last month at the UPHPU meeting, Wade Shearer presented on CSS best practices. He&#8217;s one of the few programmers in the group that&#8217;s a designer first, and a programmer second, so he has unique insight into web design. Here are &#8230; <a href="http://richardkmiller.com/209/css-best-practices">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-ca2aa3327f9cba22f83968a4575867891d787909'><p>Last month at the <a href="http://www.uphpu.org/">UPHPU meeting</a>, <a href="http://www.anavidesign.com/">Wade Shearer</a> presented on CSS best practices.  He&#8217;s one of the few programmers in the group that&#8217;s a designer first, and a programmer second, so he has unique insight into web design.  Here are my notes:</p>
<ul>
<li>Keep HTML free of presentational attributes</li>
<li>Write clean, semantic HTML</li>
<li>Use HTML tables semantically&#8211;for tabular data, not layout (generally)</li>
<li>Create <a href="http://alistapart.com/stories/goingtoprint/">print-friendly version of all your pages using media=print</a></li>
<li>For input buttons, use a 1px invisible GIF and then restyle the image with CSS:</li>
<p><code><br />
&lt;!-- HTML --&gt;<br />
&lt;input type="image" src="1px.gif" class="next_button" /&gt;</p>
<p>// CSS<br />
input.next_button<br />
{<br />
    background-image: url(next_button.gif);<br />
}<br />
</code></p>
<li>Do the same thing for image links, but for accessibility include link text overwritten by a style:</li>
<p><code><br />
&lt;!-- HTML --&gt;<br />
&lt;a href="next_page.html" class="next_button" /&gt;Next Page&lt;/a&gt;</p>
<p>// CSS<br />
a.next_button<br />
{<br />
    display: block;<br />
    background-image: url(next_button.gif);<br />
    text-indent: -99999px;<br />
}</p>
<p></code></p>
<li>Use comments in CSS to separate typography, headers, layout, forms</li>
<li>Sometimes body styles don&#8217;t cascade into tables like they should so you need to repeat body styles on all tables</li>
<li>begin with a few default styles:</li>
<p><code><br />
table, tr, td<br />
{<br />
    margin:0;<br />
    padding:0;<br />
    border:0;<br />
    border-collapse:collapse;<br />
    vertical-align:top;<br />
}</p>
<p>form<br />
{<br />
    padding:0;<br />
    margin:0;<br />
}</p>
<p>img<br />
{<br />
    border:none;<br />
    padding:0;<br />
    margin:0;<br />
}<br />
</code></p>
<li>Restyling the horizontal rule (&lt;hr&gt;) with an image can be a beautiful addition to a web page</li>
<li>Keep a library of helpful CSS classes:</li>
<p><code><br />
.float_left<br />
{<br />
	float:left;<br />
}</p>
<p>.float_right<br />
{<br />
	float:right;<br />
}</p>
<p>.clear<br />
{<br />
	clear:both;<br />
}</p>
<p>.col2_left<br />
{<br />
	float:left;<br />
	width:45%;<br />
}</p>
<p>.col2_right<br />
{<br />
	float:right;<br />
	width:45%;<br />
}<br />
</code></p>
<li>Use PHP to do browser sniffing and to include CSS files relevant to the section.</li>
<li>For more best practices, take a peak at the stylesheets for Wade&#8217;s place of employment, <a href="http://www.doba.com/">Doba.com</a></li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/209/css-best-practices/feed</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>John Taber on frameworks</title>
		<link>http://richardkmiller.com/195/john-taber-on-frameworks</link>
		<comments>http://richardkmiller.com/195/john-taber-on-frameworks#comments</comments>
		<pubDate>Sat, 08 Jul 2006 01:19:02 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/07/195</guid>
		<description><![CDATA[John Taber, traffic engineer and PHP developer, has a great post comparing the various MVC frameworks available for PHP, as well as Ruby on Rails. We really don’t care what the language is or what the plumbing looks like, just &#8230; <a href="http://richardkmiller.com/195/john-taber-on-frameworks">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-ba84b39acf6142a276ff828668fae9bfc4c5d3aa'><p><a href="http://www.johntaber.com/">John Taber</a>, traffic engineer and PHP developer, has a great post comparing the various <a href="http://www.johntaber.com/?p=10">MVC frameworks available for PHP</a>, as well as Ruby on Rails.</p>
<blockquote><p>
We really don’t care what the language is or what the plumbing looks like, just so long as we can get the program to do what we want, is super maintainable, and is fast to market. The last thing we want to do is CRUD stuff. Actually, a framework concept should be ideal for us. Which is why I looked so hard at all the choices&#8230;. These are strictly our opinions and of course, YMMV.
</p></blockquote>
<p>John compares them with a real practical sense.  On a side note, for some reason I find it funny to read a traffic engineer write &#8220;Your Mileage May Vary&#8221; (YMMV).</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/195/john-taber-on-frameworks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Report on PHP Hacker Night</title>
		<link>http://richardkmiller.com/186/report-on-php-hacker-night</link>
		<comments>http://richardkmiller.com/186/report-on-php-hacker-night#comments</comments>
		<pubDate>Fri, 02 Jun 2006 16:45:08 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/06/report-on-php-hacker-night</guid>
		<description><![CDATA[Last night John, Jonathan, Alvaro and I got together to talk PHP over dinner and dessert. I had fun and learned a lot. Here are my notes: Sitening is a web development consultancy with a bunch of cool online tools &#8230; <a href="http://richardkmiller.com/186/report-on-php-hacker-night">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-9a96cd37d8a971c7bc9b27f5b3b7533f5fd880e5'><p>Last night John, Jonathan, Alvaro and I got together to talk <a href="http://www.richardkmiller.com/blog/archives/2006/06/php-hacker-night-tonight">PHP over dinner and dessert</a>.  I had fun and learned a lot.  Here are my notes:</p>
<ul>
<li><a href="http://sitening.com/">Sitening</a> is a web development consultancy with a bunch of cool online tools and what appears to be a good blog.  (I haven&#8217;t read it yet.)  John printed a post from their blog about databases and PHP.  I&#8217;m going to subscribe to it. </li>
<li>We talked about <a href="http://www.qcodo.com/">Qcodo</a>, a code generator that John likes because it&#8217;s simple.</li>
<li>Alvaro really likes <a href="http://propel.phpdb.org/trac/">Propel</a> for creating database objects to perform CRUD operations.  It&#8217;s &#8220;intuitive&#8221; to use.</li>
<li>We discussed apt-get vs. yum, with the winner being apt-get.</li>
<li>We discussed Ruby on Rails and the similar frameworks for PHP such as <a href="http://www.cakephp.org/">Cake</a>, <a href="http://www.symfony-project.com/">Symfony</a>, and <a href="http://www.phpontrax.com/">PHP on Trax</a>.  John and Alvaro think these frameworks are too limiting, though if the scope of your project falls within the conventions of the framework they can be nice.  They both prefer a lighter-weight framework.</li>
<li>Alvaro is building a custom, light-weight framework that will be simply combine Propel and <a href="http://smarty.php.net/">Smarty</a>.  He&#8217;ll release it at <a href="http://www.protonframework.com/">protonframework.com</a> when it&#8217;s ready.</li>
<li>Alvaro recommends the <a href="http://www.openqa.org/selenium/">Selenium Firefox extension</a> for code testing and automation.  It can record each of your steps as you use your web app, then you can set up assertions (unit tests?), then you can run the recorded tests each time you make changes to your web app.  This seems like a great way to test web apps consistently and thoroughly.  I&#8217;m looking forward to trying Selenium.</li>
<li>We discussed the virtues of SVG and lamented that Internet Explorer doesn&#8217;t have better support for it.  John uses SVG extensively for creating reports and modeling streets and traffic flow in <a href="http://www.trafmetrics.com/">his work</a>.</li>
<li>Alvaro really likes XPath, a language for querying an XML document.  On the browser side, XPath is useful for finding a certain node in the DOM.  Firefox has a built-in Javascript function for running XPath queries on the DOM.</li>
<li>With AJAX John can change SVG reports in real time by changing the specific DOM node that needs to be updated.  XPath could be useful here.</li>
<li>On the server side, XPath is useful for screen scraping.  You can retrieve an HTML page, run it through Tidy to convert it to XML, then use XPath (through the PHP DOM library) to query it.  Alvaro says its easier and more portable than writing regular expressions, which is how I currently do my screen scraping.</li>
<li>There are <a href="https://addons.mozilla.org/search.php?q=xpath&#038;app=firefox">Firefox extensions for working with XPath</a>.  They allow you to click anywhere on a web page and see the XPath query that would retrieve that element.</li>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/0321127420" rel="nofollow">Martin Fowler&#8217;s book</a> was recommended.</li>
<li>By using the Apache directive &#8220;ForceType&#8221;, you can forgo the &#8220;.php&#8221; extension on your files and create pretty URL&#8217;s.  (ALL of your files are parsed for PHP.)</li>
</ul>
<p>The food was good and the company was excellent.  I look forward to doing this again.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/186/report-on-php-hacker-night/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Hacker Night tonight</title>
		<link>http://richardkmiller.com/185/php-hacker-night-tonight</link>
		<comments>http://richardkmiller.com/185/php-hacker-night-tonight#comments</comments>
		<pubDate>Thu, 01 Jun 2006 23:55:33 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/06/php-hacker-night-tonight</guid>
		<description><![CDATA[John Taber and I are pudding (sic) on a &#8220;PHP Hacker Night&#8221; tonight. We&#8217;ll be meeting for dinner at 7:30 at Las Tarascas [map] in Provo. Dessert will be at Pudding on the Rice, which is next door. Both restaurants &#8230; <a href="http://richardkmiller.com/185/php-hacker-night-tonight">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-4ffb6246fc3d5d859e2d535f2f03b05a4aee6e56'><p><a href="http://www.johntaber.com/">John Taber</a> and I are pudding (sic) on a &#8220;PHP Hacker Night&#8221; tonight.  We&#8217;ll be meeting for dinner at 7:30 at Las Tarascas <a href="http://tinyurl.com/n5ncn" rel="nofollow">[map]</a> in Provo.  Dessert will be at <a href="http://www.puddingontherice.com/">Pudding on the Rice</a>, which is next door.  Both restaurants have free wifi, so bring your laptops.  We&#8217;ll discuss PHP programming and any technology topics that come to mind.</p>
<p>For more information see the UPHPU website: <a href="http://uphpu.org/article.php?story=2006053013025815">PHP Hacker Night</a></p>
<p>Disclaimer: I realize I&#8217;m posting this less than 2 hours before game time, but if you read this in time you&#8217;re probably in the target audience, so come!</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/185/php-hacker-night-tonight/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Password protecting MediaWiki with mod_auth_mysql</title>
		<link>http://richardkmiller.com/184/password-protecting-mediawiki-with-mod_auth_mysql</link>
		<comments>http://richardkmiller.com/184/password-protecting-mediawiki-with-mod_auth_mysql#comments</comments>
		<pubDate>Thu, 25 May 2006 14:55:45 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2006/05/password-protecting-mediawiki-with-mod_auth_mysql</guid>
		<description><![CDATA[MediaWiki is the powerful software on which Wikipedia and many other sites are built. It does not, however, come with the option to password protect pages from being viewed. (It can password protect pages from being edited.) If you need &#8230; <a href="http://richardkmiller.com/184/password-protecting-mediawiki-with-mod_auth_mysql">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-ec6fe6a8aacaa2fe297cff05de65a56f3ac2446e'><p>MediaWiki is the powerful software on which Wikipedia and many other sites are built.  It does not, however, come with the option to password protect pages from being viewed.  (It can password protect pages from being edited.)</p>
<p>If you need to setup a private, members-only wiki for internal use, here is how you can do it with <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> software and the Apache server extension <a href="http://modauthmysql.sourceforge.net/">mod_auth_mysql</a>:</p>
<p>1. Install MediaWiki as usual.  Create a user account for yourself.</p>
<p>2. Add the following line to your LocalSettings.php file, located in the root of your MediaWiki installation.  This will cause MediaWiki to use a simple MD5 hash for user passwords in the database, instead of the more complicated &#8220;salted hash hash&#8221; that it normally uses.</p>
<p><code>$wgPasswordSalt = false;</code></p>
<p>3. Activate mod_auth_mysql in Apache.  This is usually done with a LoadModule line in your Apache configuration file (httpd.conf), provided the module is available.  (If not, you may need to compile or download the module.)</p>
<p><code>LoadModule mysql_auth_module  libexec/apache2/mod_auth_mysql.so</code></p>
<p>4. Create a new MySQL user that has SELECT access to the &#8220;user_name&#8221; and &#8220;user_password&#8221; fields in the &#8220;user&#8221; table of your MediaWiki installation.  Apache will use this MySQL user for connecting to the MediaWiki database.</p>
<p>5. Configure mod_auth_mysql to use the MediaWiki user table for authentication by placing the follow directives in your Apache configuration file:</p>
<p><code><br />
<directory "/path/to/your/MediaWiki/installation"><br />
  AuthName "This wiki is password protected (make sure the first letter of the username is Uppercase)"<br />
  AuthType Basic<br />
  require valid-user<br />
  AuthMySQLEnable On<br />
  AuthMySQLHost localhost<br />
  AuthMySQLUser unprivilegeduser<br />
  AuthMySQLPassword thesecretpassword<br />
  AuthMySQLDB mediawikidatabase<br />
  AuthMySQLUserTable user<br />
  AuthMySQLNameField user_name<br />
  AuthMySQLPasswordField user_password<br />
  AuthMySQLPwEncryption md5<br />
  AuthMySQLAuthoritative On<br />
</directory><br />
</code></p>
<p>6. Restart Apache.</p>
<p>Your installation of MediaWiki should now be password-protected, but your username and password will let you in.  This protects the entire wiki; no one will even know that MediaWiki is present until they login.  To give other people access, you can either create user accounts for them, or you can create a guest account that they can use until they sign themselves up.  </p>
<p>P.S. Thanks to <a href="http://www.thornock.us/wordpress/">Gary Thornock</a> for helping me with the details of installing mod_auth_mysql on FreeBSD.</p>
<p>UPDATE (2008-09-11):<br />
The latest version of MediaWiki (version 1.13) uses a new password format which is incompatible with mod_auth_mysql. It prepends &#8220;:A:&#8221; to each MD5 hash. Here is a workaround:</p>
<p>1. Create a MySQL view that mirrors the username and password, minus the prefix:<br />
<code>CREATE VIEW user_view AS SELECT user_id, user_name, substring_index(user_password, ':', -1) AS user_password FROM user;</code><br />
2. Configure mod_auth_mysql to use <code>user_view</code> instead of <code>user</code> as the lookup table.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/184/password-protecting-mediawiki-with-mod_auth_mysql/feed</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
	</channel>
</rss>

