<?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>Push cx &#187; PHP</title>
	<atom:link href="http://push.cx/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://push.cx</link>
	<description>A traveling geek&#039;s blog on development, games, and the web</description>
	<lastBuildDate>Thu, 19 Apr 2012 20:39:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>SPWA Week 2: Funding and Forms</title>
		<link>http://push.cx/2011/spwa-week-2-funding-and-forms</link>
		<comments>http://push.cx/2011/spwa-week-2-funding-and-forms#comments</comments>
		<pubDate>Sat, 11 Jun 2011 00:03:25 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[satisficing]]></category>
		<category><![CDATA[so play we all]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://push.cx/?p=1767</guid>
		<description><![CDATA[So Play We All is partly a motivation hack, with teammates/competitors and penalties to make sure we each put in time towards our games. Luke&#8217;s job sent him to a conference for almost all of the week, so he didn&#8217;t get to do any of his hours. He&#8217;s paying us both $20. To keep anyone [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zb3BsYXl3ZWFsbC5jb20=">So Play We All</a> is partly a motivation hack, with teammates/competitors and penalties to make sure we each put in time towards our games. Luke&#8217;s job sent him to a conference for almost all of the week, so he didn&#8217;t get to do any of his hours. He&#8217;s paying us both $20. To keep anyone from falling behind, we&#8217;ve tweaked the rules to say that anyone who pays the penalty for missed hours can make them up when they have the time.
</p>

<p>
Meanwhile, Jim&#8217;s done great, getting code live for the first time. I took a screenshot:
</p>

<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDYvU2VsZWN0aW9uXzAwMS5wbmc="><img src="http://push.cx/wp-content/uploads/2011/06/Selection_001.png" alt="Allabrilyn Exclusive First Screenshot!" title="Allabrilyn Exclusive First Screenshot!" width="767" height="32" class="alignnone size-full wp-image-1769" /></a>

<p>
The first page has a simple login form. There&#8217;s no way to register an account, and any login/password you enter gives you the above message. In his <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuYWxsYWJyaWx5bi5jb20vY29udGVudC9sb25nLXdheS1jb2Rl">blog post</a>, Jim wrote about the code 
</p>

<blockquote>
At that point, it was a fairly easy task to take the user object and add its data to the display for rendering. I chose to go with something like:

<blockquote>
Hello %user%! Your account was created at %time% on %date% and you last logged in at %time% on %date%. Enjoy your stay!
</blockquote>
</blockquote>

<p>
<b>STOP IT</b>. You are writing a template language in a template language! Templates are the one thing PHP actually does pretty decently (well, it&#8217;s not <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5oYW1sLWxhbmcuY29t">Haml</a>, but it&#8217;s way better than <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpa2kuem9wZS5vcmcvWlBUL1RBTFNwZWNpZmljYXRpb24xNA==">TAL</a>)! Wrap PHP&#8217;s output buffering around <kbd>include()</kbd> and get on with your life before you find yourself implementing conditionals and loops.
</p>

<p>
This is part of a larger topic I have to respond to:
</p>

<blockquote>
<p>This is mostly because I had to rush myself just to even get this far and put in lots of sloppy code. So, I&#8217;ve decided that I don&#8217;t care how far ahead the others get, I am not going to worry about matching their pace.</p>

<p>Really, it was an unrealistic goal that I&#8217;m glad to be letting go of. They&#8217;re using a pre-built framework which means they have options to solve a lot of their issues right out of the box. I, on the other hand, have to implement even my low-level functionality. This means that I&#8217;m going to be slower to execute no matter what happens. That&#8217;s the price that I pay for wanting to use my own implementation. The positive upside is that once I manage to solve these issues, they&#8217;ll be solved for me in all of my future games and I&#8217;ll be able to skip this tedium the next time around. &#8230;</p>

<p>Sure, it slows me down in terms of this competition, however, I will have 100% control over every aspect of the process which is not something that I would have if I were to leverage Drupal to build the game.</p>
</blockquote>

<p>
I know you write good code, Jim, but <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TYXRpc2ZpY2U=">satisfice</a>, man. You&#8217;ve got the worst time demands of all of us. Luke and I aren&#8217;t barfing into our editors and making sure it passes a syntax check, we&#8217;re taking acceptable components from other people so we spend our time on the important bits.
</p>

<p>
Last week I <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cub2Fxbi5jb20vMjAxMS93ZWVrLTItcHJldHR5LXNoYW1lbGVzcw==">bought and added a theme to Oaqn</a>. I was hugely tempted to tear it apart and make sure everything was perfect, with semantic class names and no unused code and efficient selectors and and and&#8230; Instead I added achievements, a feature that will help inspire and retain players for the lifetime of my game. That code&#8217;s not perfect, either, I already know I&#8217;ll want to tweak it to add some kind of bronze/silver/gold upgrading medals &mdash; but now I&#8217;ve got something decent in place and I can get closer to a running game.
</p>

<a href=http://makegames.tumblr.com/post/1136623767/finishing-a-game""><img src="http://push.cx/wp-content/uploads/2011/06/finishgame01.jpg" alt="" title="Finish a game" width="500" height="300" class="alignnone size-full wp-image-1770" /></a>

<p>
<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21ha2VnYW1lcy50dW1ibHIuY29tL3Bvc3QvMTEzNjYyMzc2Ny9maW5pc2hpbmctYS1nYW1l">Finish a game</a>. So Play We All.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1767" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2011/spwa-week-2-funding-and-forms/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Hex Map Graphics</title>
		<link>http://push.cx/2010/php-hex-map-graphics</link>
		<comments>http://push.cx/2010/php-hex-map-graphics#comments</comments>
		<pubDate>Sun, 13 Jun 2010 02:24:46 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[hex maps]]></category>
		<category><![CDATA[image generation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web games]]></category>

		<guid isPermaLink="false">http://push.cx/?p=1392</guid>
		<description><![CDATA[This PHP code uses the GD functions to create hex map images (eg. for wargames). Leland on GitHub Features: Shapes: rectangule, hexagonal (&#8216;circle&#8217;), freeform (&#8216;free&#8217;) Variable hex sizes shape() to calculate distance in hexes highlight a hex set a border on a hex color a hex add text to a hex I swear it used [...]]]></description>
			<content:encoded><![CDATA[<p>
This PHP code uses the GD functions to create hex map images (eg. for wargames).
</p>

<p><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2dpdGh1Yi5jb20vcHVzaGN4L2xlbGFuZA==">Leland on GitHub</a></p>

<h2>Features:</h2>

<ul>
  <li>Shapes: rectangule, hexagonal (&#8216;circle&#8217;), freeform (&#8216;free&#8217;)</li>
  <li>Variable hex sizes</li>
  <li>shape() to calculate distance in hexes</li>
  <li>highlight a hex</li>
  <li>set a border on a hex</li>
  <li>color a hex</li>
  <li>add text to a hex</li>
  <li>I swear it used to allow setting a background picture, but I don&#8217;t see that functionality so maybe I dreamed it or lost it when I misplaced this code for four years.</li>
</ul>

<h2>Known Issues</h2>

<p>
The code has ugly styling (tabs, odd spacing, no optional braces) &#8211; sorry, I was young(er) and stupid(er).
</p>

<p>
There&#8217;s a fair amount of temporal coupling in there &#8211; functions that you can&#8217;t call before other functions, etc. I hadn&#8217;t heard of the command pattern or closures yet.
</p>

<img src="http://push.cx/wp-content/uploads/2010/06/hex_map_test.png" alt="" title="Hex map test" width="191" height="161" class="alignnone size-full wp-image-1395 content" />

<p>
There&#8217;s a bug in the &#8216;circle&#8217; shape (that the following code exercises):
</p>

<pre>&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">require</span> <span style="color: #ff0000;">'class_hex_image.php'</span>;
&nbsp;
<span style="color: #0000ff;">$radius</span> = <span style="color: #cc66cc;">3</span>;
<span style="color: #0000ff;">$map</span> = <span style="color: #000000; font-weight: bold;">new</span> Hex_image;
<span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">set_color</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'bg'</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">set_l</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">set_shape</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'circle'</span>, <span style="color: #0000ff;">$radius</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$x</span> = <span style="color: #cc66cc;">1</span>; <span style="color: #0000ff;">$x</span> &lt;= <span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">xsize</span>; <span style="color: #0000ff;">$x</span>++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$y</span> = <span style="color: #cc66cc;">1</span>; <span style="color: #0000ff;">$y</span> &lt;= <span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">ysize</span>; <span style="color: #0000ff;">$y</span>++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$x</span>, <span style="color: #0000ff;">$y</span>, <span style="color: #ff0000;">'black'</span>, <span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">steps</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$x</span>, <span style="color: #0000ff;">$y</span>, <span style="color: #0000ff;">$radius</span>, <span style="color: #0000ff;">$radius</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #808080; font-style: italic;">// nice for getting a feel for coordinates</span>
        <span style="color: #808080; font-style: italic;">//$map-&gt;text($x, $y, 'black', &quot;$x,$y&quot;);</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2hlYWRlcg=="><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Content-Type: image.png'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$map</span>-&gt;<span style="color: #006600;">finish</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;       <span style="color: #808080; font-style: italic;">// calls imagepng()</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>

<h2>Future</h2>

<p>
One of the guys in #bbg on irc,freenode.net is building a browser-based game with a hex map and I remembered this code was squirreled away somewhere on my hard drive. I have no plans to fix, improve, or in any way maintain this code. I figure I may as well release it so someone can do something with it.
</p>

<h2>License</h2>

<p>
I release this code to the public domain. You may use it for any purpose with or without attribution. It would be polite to mention my name and let me know you come up with, but it&#8217;s not at all required.
</p>
 <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1392" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2010/php-hex-map-graphics/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Investigating Theme Spam</title>
		<link>http://push.cx/2009/investigating-theme-spam</link>
		<comments>http://push.cx/2009/investigating-theme-spam#comments</comments>
		<pubDate>Fri, 05 Jun 2009 12:45:23 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[decoding]]></category>
		<category><![CDATA[obfuscation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://push.cx/?p=1115</guid>
		<description><![CDATA[If you&#8217;re interested in what spammers are up to these days, check out Snarky&#8217;s blog post Evil Eval() investigating the obfuscated spam code hidden in the new WordPress theme he downloaded. I&#8217;d be really interested to see how many of the themes on various WordPress sites include function calls like eval, call_user_func, base64_decode, unpack, ord, [...]]]></description>
			<content:encoded><![CDATA[<p>
If you&#8217;re interested in what spammers are up to these days, check out Snarky&#8217;s blog post <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RoZXNuYXJreS5jb20vMjAwOS8wNi8wNC9ldmlsLWV2YWwv">Evil Eval()</a> investigating the obfuscated spam code hidden in the new WordPress theme he downloaded.
</p>

<p>
I&#8217;d be really interested to see how many of the themes on various WordPress sites include function calls like eval, call_user_func, base64_decode, unpack, ord, chr, etc. as an indicator of hidden spam.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1115" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2009/investigating-theme-spam/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building Clean URLs Into a Site</title>
		<link>http://push.cx/2006/building-clean-urls-into-a-site</link>
		<comments>http://push.cx/2006/building-clean-urls-into-a-site#comments</comments>
		<pubDate>Fri, 23 Jun 2006 17:26:28 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://push.cx/2006/building-clean-urls-into-a-site</guid>
		<description><![CDATA[I wrote about building a site with clean URLs, but that&#8217;s useless to you. No, you&#8217;ve got a creaking hulking monster of a site that coughs up URLs like &#8220;render.php?action=list_mailbox&#038;id=42189&#8243;, was built &#8220;to meet an accelerated schedule&#8221;, and eats summer interns whole. This article tells you how to put clean and human-usable URLs on top [...]]]></description>
			<content:encoded><![CDATA[<p>
I wrote about <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvMjAwNi9idWlsZGluZy1hLXNpdGUtd2l0aC1jbGVhbi11cmxz">building a site with clean URLs</a>, but that&#8217;s useless to you. No, you&#8217;ve got a creaking hulking monster of a site that coughs up URLs like &#8220;render.php?action=list_mailbox&#038;id=42189&#8243;, was built &#8220;to meet an accelerated schedule&#8221;, and eats summer interns whole.
</p>

<p>
This article tells you how to put clean and human-usable URLs on top of the site without even editing your underlying scripts. All these examples mention PHP but it doesn&#8217;t matter what you coded the site in, you just have to be running Apache and have a little familiarity with regular expressions.
</p>

<p>
So we have two goals. First, requests for the new URL are internally rewritten to call the existing scripts without users ever knowing they exist. Second, requests for the old URLs get a 301 redirect to the new URLs so that search engines and good bookmarks immediately switch to the new URLs.
</p>

<p>
Let&#8217;s work through an example <kbd>.htaccess</kbd> file. We take apart the new URLs and map them internally to the old URLs:
</p>

<pre>
RewriteEngine on

RewriteRule ^new/(.*)/(.*)$ /old.php?action=$1&#038;id=$2 [L]
</pre>

<p>
This works great, so we dive into the 301 redirects:
</p>

<pre>
RewriteEngine On

RewriteRule ^new/(.*)/(.*)$ /old.php?action=$1&#038;id=$2 [L]
RewriteCond %{QUERY_STRING} ^action=([a-z]+)&#038;id=([0-9]+)
RewriteRule ^old\.php$ /new/%1/%2? [R=301,L]
</pre>

<p>
<i>Arrrgh!</i> We test this and find a problem: all requests for <kbd>new</kbd> are getting 301 redirected back to <kbd>new</kbd>. Apache is rewriting <kbd>new</kbd> to <kbd>old</kbd> fine, but then it sends the new URL back through mod_rewrite again so we&#8217;re stuck in an infinite loop of redirects (even though the <kbd>[L]</kbd> option is supposed to tell Apache to stop applying rules). We need to turn it up to 11 and tell Apache &#8220;No, really, stop rewriting URLs now&#8221; by setting a flag that it already rewrote the URL.
</p>

<pre>
RewriteEngine on
# This rule just keeps DirectoryIndex working (so requests for / go to /index.php or whatever)
RewriteRule ^$ - [L]
# Set an environment variable REWROTE that we haven't done any rewriting
RewriteRule ^(.*)$ $1 [E=REWROTE:0]

# Flag that the new URL rewrote
RewriteRule ^new/(.*)/(.*)$ /old.php?action=$1&#038;id=$2 [L,E=REWROTE:1]
# Only rewrote the old url if we didn't rewrite
RewriteCond %{ENV:REWROTE} !^1$
RewriteCond %{QUERY_STRING} ^action=([a-z]+)&#038;id=([0-9]+)
RewriteRule ^old\.php$ /new/%1/%2? [R=301,L]
</pre>

<p>
This set of rewrite rules accomplishes both our goals and the new URLs are all we&#8217;ll ever see in the address bar. You can set up any number of rewritten URLs (there&#8217;s no need to repeat the code turning on rewriting and REWROTE flag), editing them for your particular GET variables and layout.
</p>

<p>
Proudly displaying our shiny new URLs, we can send in surgical teams into the site&#8217;s source code file-by-file, slowly and carefully replacing instances of the old URLs with the new ones. Once all the URLs are replaced, you can watch your server logs to see usage of the old URLs fall off. The way is now prepared for you to further beautify your site inside and out.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=142" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/building-clean-urls-into-a-site/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Developing With Evil</title>
		<link>http://push.cx/2006/developing-with-evil</link>
		<comments>http://push.cx/2006/developing-with-evil#comments</comments>
		<pubDate>Thu, 15 Jun 2006 19:50:06 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://push.cx/2006/developing-with-evil</guid>
		<description><![CDATA[allaryin: whee&#8230; allaryin: i&#8217;ve been given a job to put a simple email address subscription form on a site Harkins: sounds pretty easy allaryin: and&#8230; as far as i can tell, the server has neither php nor perl :P allaryin: i&#8217;m running out of options :P Harkins: cgi, baby allaryin: for db access? Harkins: Or [...]]]></description>
			<content:encoded><![CDATA[<p>
<span style="color: red">allaryin</span>: whee&#8230;<br />
<span style="color: red">allaryin</span>: i&#8217;ve been given a job to put a simple email address subscription form on a site<br />
<span style="color: blue">Harkins</span>: sounds pretty easy<br />
<span style="color: red">allaryin</span>: and&#8230; as far as i can tell, the server has neither php nor perl :P<br />
<span style="color: red">allaryin</span>: i&#8217;m running out of options :P<br />
<span style="color: blue">Harkins</span>: cgi, baby<br />
<span style="color: red">allaryin</span>: for db access?<br />                  <span style="color: blue">Harkins</span>: Or change the target of the form to a server you control running PHP/perl that saves the data and redirects back to the other server.<br />
<span style="color: red">allaryin</span>: yeah&#8230;<br />                         <span style="color: red">allaryin</span>: but i really don&#8217;t want to commit any of our server resources to their site :P<br />
<span style="color: green">BSDCat</span>: I think a &#8216;simplicity&#8217; fairy just lost its wings<br />
<span style="color: blue">Harkins</span>: Or make the form GET and write a cron job to scrape access.log.<br />
<span style="color: red">allaryin</span>: &#8230;<br />
<span style="color: red">allaryin</span>: wow.<br />
<span style="color: blue">Harkins</span>: Yes, I&#8217;m evil.<br />
<span style="color: red">allaryin</span>: it&#8217;s beautiful really<br />
<span style="color: blue">Harkins</span>: bwa<br />
<span style="color: red">allaryin</span>: but yes, evil<br />
</p>
 <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=129" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/developing-with-evil/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Site With Clean URLs</title>
		<link>http://push.cx/2006/building-a-site-with-clean-urls</link>
		<comments>http://push.cx/2006/building-a-site-with-clean-urls#comments</comments>
		<pubDate>Wed, 07 Jun 2006 18:37:26 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://push.cx/2006/building-a-site-with-clean-urls</guid>
		<description><![CDATA[As an aside in my post about Cambrian House I posted some code for making pretty URLs. A few people (no, not CH) have asked for a little more info, so I&#8217;ve written up an explanation of that code. PHP makes it very easy to create bad URLs like /member.php?id=8. Those are bad because web [...]]]></description>
			<content:encoded><![CDATA[<p>
As an aside in <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvMjAwNi9wcmUtY2FtYnJpYW4taG91c2U=">my post about Cambrian House</a> I posted some code for making pretty URLs. A few people (no, not CH) have asked for a little more info, so I&#8217;ve written up an explanation of that code.
</p>

<p>
PHP makes it very easy to create bad URLs like <kbd>/member.php?id=8</kbd>. Those are bad because web spiders don&#8217;t like to crawl URLs with GET variables, some browsers don&#8217;t cache any GET URLs, they expose that you use PHP (when the visitor should never even know), and they&#8217;re just downright ugly and hard to remember. I&#8217;m going to present a way to build a PHP/Apache site with clean URLs.
</p>

<p>
Let&#8217;s look, line-by-line, at the contents of <kbd>.htaccess</kbd>. While writing this article I found a more elegant equivalent in the WordPress code, so I&#8217;ll present that here:
</p>

<pre>
# Tell Apache to load mod_rewrite.
RewriteEngine On
# Rewrite URLs for the location starting at /
# Note this is URL location, not a path to your web root.
RewriteBase /
# If the request asks for a file or directory that doesn't exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# send the request to index.php.
RewriteRule . /index.php [L]
</pre>

<p>
The hard part about this change is the shift in thinking. A URL isn&#8217;t just a path to a file you FTP&#8217;d to a web server, it&#8217;s a Universal Resource Locator, an address for information. It doesn&#8217;t matter whether your site presents data taken from files, a database, or a random number generator &#8212; a web browser requests a URL and knows nothing about where the website gets it from.
</p>

<p>
With that in mind, let&#8217;s look at how your PHP site can take apart the URL to route the request to the right PHP script. Create an index.php that looks like:
</p>

<pre>&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> url_parse<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">// strip off get vars and anchor tags</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'?'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'?'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'#'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'#'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #808080; font-style: italic;">//remove leading slash and possible trailing slash, store in $url</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <span style="color: #ff0000;">''</span>;
        <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2V4cGxvZGU="><span style="color: #000066;">explode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/'</span>, <span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span>;
        
        <span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$actions</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2FycmF5"><span style="color: #000066;">Array</span></a><span style="color: #66cc66;">&#40;</span>
    <span style="color: #ff0000;">""</span> =&gt; <span style="color: #ff0000;">"front_page.php"</span>,
    <span style="color: #ff0000;">"mail"</span> =&gt; <span style="color: #ff0000;">"mail.php"</span>,
    <span style="color: #ff0000;">"member"</span> =&gt; <span style="color: #ff0000;">"profile.php"</span>,
    <span style="color: #ff0000;">"messageboard"</span> =&gt; <span style="color: #ff0000;">"boards.php"</span>,
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$url</span> = url_parse<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SERVER</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'REQUEST_URI'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$action</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2FycmF5X3NoaWZ0"><span style="color: #000066;">array_shift</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2FycmF5X2tleV9leGlzdHM="><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$action</span>, <span style="color: #0000ff;">$actions</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$actions</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$action</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"404.php"</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<p>
So <kbd>index.php</kbd> takes the first element off the array, and probably uses it to <kbd>require()</kbd> specific templates or scripts that do the work with the rest of the <kbd>$url</kbd> array. Think of it like a switchboard operator &#8212; it sends requests where they need to go.
</p>

<p>
Your individual pages can <kbd>array_shift()</kbd> their arguments from the <kbd>$url</kbd> array. In the example above, <kbd>profile.php</kbd> would expect a username or ID number, and it can <kbd>require("404.php");</kbd> if there&#8217;s nothing there or no user by that id.
</p>

<p>
More complex nested URLs (say, <kbd>/messageboard/chat/new_thread</kbd>) work much the same way <kbd>index.php</kbd> works: the base script examines <kbd>$url</kbd> and passes it on to the scripts it knows about. In the example above, <kbd>boards.php</kbd> can load the requested board or the pages used to create a new post or a new board.
</p>

<p>
In my next post, I&#8217;ll provide <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvMjAwNi9idWlsZGluZy1jbGVhbi11cmxzLWludG8tYS1zaXRl">a clean URL solution for existing sites</a> that can&#8217;t afford to redesign their PHP scripts.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=123" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/building-a-site-with-clean-urls/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Pre-Cambrian House</title>
		<link>http://push.cx/2006/pre-cambrian-house</link>
		<comments>http://push.cx/2006/pre-cambrian-house#comments</comments>
		<pubDate>Thu, 01 Jun 2006 23:41:11 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Biz]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cambrian House]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://push.cx/2006/pre-cambrian-house</guid>
		<description><![CDATA[I was poking around reddit and followed a link to CambrianCode.com, an all-Flash (ugh!) puzzle game. There&#8217;s a few of these &#8220;guess how to get to next level&#8221; games online and they all just annoy me. Yes, you&#8217;re so clever. No, I find patronization alluring. Yes, I&#8217;ll spend my time on this for no discernable [...]]]></description>
			<content:encoded><![CDATA[<p>
I was poking around reddit and followed a link to <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jYW1icmlhbmNvZGUuY29t">CambrianCode.com</a>, an all-Flash (ugh!) puzzle game. There&#8217;s a few of these &#8220;guess how to get to next level&#8221; games online and they all just annoy me. Yes, you&#8217;re so clever. No, I find patronization alluring. Yes, I&#8217;ll spend my time on this for no discernable reward.
</p>

<p>
The puzzle is run by <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NhbWJyaWFuaG91c2UuY29t">Cambrian House</a>, a mysteeeeerious <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL29uc3RhcnR1cHMuY29tL0hvbWUvdGFiaWQvMzMzOS9hcnRpY2xlVHlwZS9BcnRpY2xlVmlldy9hcnRpY2xlSWQvNTk3L1N0ZWFsdGhNb2RlU2NobWVhbHRoTW9kZVRoZVJlYWxSZWFzb25zV2h5U3RhcnR1cHNEb250VGFsay5hc3B4">stealth startup</a> that has only a teaser page online. If there&#8217;s one thing that annoys me more than Flash puzzle-level games, it&#8217;s stealth startups. 
</p>

<p>
So I went poking around some more and found a development copy of their website. And much to my surprise, it&#8217;s actually a darn cool business idea. So cool that after I wrote a whole &#8220;Mwaha, I&#8217;m raising the curtain early!&#8221; post I thought better of it and am only going to post this for now. It was clever and fun, there&#8217;s going to be a ridiculous amount of buzz around this company when it launches. And I got to register as user #9, which was damn funny when I noticed their &#8220;About Us&#8221; page lists 17 employees.
</p>

<p>
Confidential to CH in Calgary: it&#8217;s really tacky to litter your URLs with &#8220;.php&#8221; and get variables. Put the following in your .htaccess file and have index.php take apart the URL with the PHP code below and route to your different pages. URLs like &#8220;/community/member/Harkins&#8221; look much nicer than &#8220;/community/member-profile.php?users_id=9&#8243;. (Or ask me about mod_rewrite.)
</p>

<pre>
&lt;Location /secret_development_environment&gt;
    Order Deny,Allow
    Deny from all
    Allow from 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 .cambrianhouse.com
&lt;/Location&gt;

RewriteEngine On
RewriteCond    %{REQUEST_FILENAME}  -d [OR]
RewriteCond    %{REQUEST_FILENAME}  -f
RewriteRule     ^(.*)$  - [L]

RewriteRule ^(index.*) - [QSA,L]
RewriteRule ^([^.]*)$ /index.php [QSA,L]
</pre>

<pre>&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> url_parse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$url</span> = <span style="color: #0000ff;">$_SERVER</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'REQUEST_URI'</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
        <span style="color: #808080; font-style: italic;">// we don't want to pass get vars or anchor tags on to the script</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'?'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'?'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'#'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N0cnBvcw=="><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #ff0000;">'#'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #808080; font-style: italic;">//remove leading slash and possible trailing slash, store in $url</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L3N1YnN0cg=="><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span>, <span style="color: #cc66cc;">0</span>, -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span> == <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0000ff;">$url</span> = <span style="color: #ff0000;">''</span>;
        <span style="color: #0000ff;">$url</span> = <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0L2V4cGxvZGU="><span style="color: #000066;">explode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/'</span>, <span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span>;
        
        <span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>

<div class="update">
Cambrian House house <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvMjAwNi9jYW1icmlhbi1kZXZlbG9wbWVudA==">responded</a> to me.
</div> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=121" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/pre-cambrian-house/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

