<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>Chris Weldon's Blog</title>
	<link>http://www.chrisweldon.net</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sat, 30 Aug 2008 23:23:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>The Magical Realm of Edon - A Review</title>
		<link>http://www.chrisweldon.net/2008/08/30/the-magical-realm-of-edon-a-review</link>
		<comments>http://www.chrisweldon.net/2008/08/30/the-magical-realm-of-edon-a-review#comments</comments>
		<pubDate>Sat, 30 Aug 2008 23:23:29 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Events]]></category>

		<category><![CDATA[edon]]></category>

		<category><![CDATA[magic]]></category>

		<category><![CDATA[theater]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/08/30/the-magical-realm-of-edon-a-review</guid>
		<description><![CDATA[This is a bit late, but something that&#8217;s been quite deserved. 
John &#8220;Cash&#8221; Carpenter and Darwin Gilmore presented 3 limited performances from August 7 to August 9, 2008 of both a magic show and a theater performance, dubbed the Magical Realm of Edon. Stephen Blaschke was director and choreographer. In a nutshell, this performance had [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bit late, but something that&#8217;s been quite deserved. </p>
<p>John &#8220;Cash&#8221; Carpenter and Darwin Gilmore presented 3 limited performances from August 7 to August 9, 2008 of both a magic show and a theater performance, dubbed the <a href="http://www.theatreport.com/modules/newbb/viewtopic.php?topic_id=4403&#038;forum=8">Magical Realm of Edon</a>. Stephen Blaschke was director and choreographer. In a nutshell, this performance had to be one of the most visually stunning and exciting presentations of illusions I&#8217;ve seen in quite a long time. </p>
<p> <a href="http://www.chrisweldon.net/2008/08/30/the-magical-realm-of-edon-a-review#more-117" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/08/30/the-magical-realm-of-edon-a-review/feed</wfw:commentRss>
		</item>
		<item>
		<title>Several Reasons why Hostgator is a terrible host</title>
		<link>http://www.chrisweldon.net/2008/08/22/several-reasons-why-hostgator-is-a-terrible-host</link>
		<comments>http://www.chrisweldon.net/2008/08/22/several-reasons-why-hostgator-is-a-terrible-host#comments</comments>
		<pubDate>Sat, 23 Aug 2008 02:59:16 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Administration]]></category>

		<category><![CDATA[bad practices]]></category>

		<category><![CDATA[horrible]]></category>

		<category><![CDATA[hostgator]]></category>

		<category><![CDATA[recommendation]]></category>

		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/08/22/several-reasons-why-hostgator-is-a-terrible-host</guid>
		<description><![CDATA[I&#8217;ll leave these mostly in the form of hyperlinks to their own forums:
1) They store passwords in cleartext
2) HostGator doesn&#8217;t send maintenance notices through email
3) HostGator throttles emails from each domain
4) Despite throttling (see #3), HostGator&#8217;s servers still get blacklisted
5) HostGator&#8217;s support team does actually ask for passwords, which is a no-no in the tech [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll leave these mostly in the form of hyperlinks to their own forums:</p>
<p>1) <a href="http://forums.hostgator.com/forced-password-update-t33170.html">They store passwords in cleartext</a><br />
2) <a href="http://forums.hostgator.com/showpost.php?p=130803&#038;postcount=5">HostGator doesn&#8217;t send maintenance notices through email</a><br />
3) <a href="http://forums.hostgator.com/showpost.php?p=13829&#038;postcount=1">HostGator throttles emails from each domain</a><br />
4) <a href="http://forums.hostgator.com/showpost.php?p=63807&#038;postcount=1">Despite throttling (see #3), HostGator&#8217;s servers still get blacklisted</a><br />
5) <a href="http://forums.hostgator.com/showpost.php?p=126721&#038;postcount=1">HostGator&#8217;s support team does actually ask for passwords, which is a no-no in the tech biz</a></p>
<p>I could list a dozen others, but clearly this is ridiculous. I&#8217;m moving away from them ASAP and I suggest that anyone else do the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/08/22/several-reasons-why-hostgator-is-a-terrible-host/feed</wfw:commentRss>
		</item>
		<item>
		<title>Photo Teaser - Magical Realm of Edon</title>
		<link>http://www.chrisweldon.net/2008/08/13/photo-teaser-magical-realm-of-edon</link>
		<comments>http://www.chrisweldon.net/2008/08/13/photo-teaser-magical-realm-of-edon#comments</comments>
		<pubDate>Wed, 13 Aug 2008 06:11:12 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<category><![CDATA[edon]]></category>

		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/08/13/photo-teaser-magical-realm-of-edon</guid>
		<description><![CDATA[I took some action photos of the Magical Realm of Edon that my wonderful wife Melissa was a part of. She played the part of Eternity, the goddess in control of the realm. I have posted 4 teaser photos. I&#8217;m not done with them or with all of the other photos (approximately 150 of them) [...]]]></description>
			<content:encoded><![CDATA[<p>I took some action photos of the Magical Realm of Edon that my wonderful wife <a href="http://www.ladyalissiya.net">Melissa</a> was a part of. She played the part of Eternity, the goddess in control of the realm. I have posted <a href="/EdonTeaser/" title="Magical Realm of Edon teaser photos">4 teaser photos</a>. I&#8217;m not done with them or with all of the other photos (approximately 150 of them) as I&#8217;m currently doing my usual photo editing bit with them. When I&#8217;ve got them all edited, I will send them for the director&#8217;s and creator&#8217;s review prior to posting them to my web site. Let me know what y&#8217;all think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/08/13/photo-teaser-magical-realm-of-edon/feed</wfw:commentRss>
		</item>
		<item>
		<title>Solaris 10 - Nagios and GD Compile Issues</title>
		<link>http://www.chrisweldon.net/2008/07/01/solaris-10-nagios-and-gd-compile-issues</link>
		<comments>http://www.chrisweldon.net/2008/07/01/solaris-10-nagios-and-gd-compile-issues#comments</comments>
		<pubDate>Tue, 01 Jul 2008 23:53:16 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Administration]]></category>

		<category><![CDATA[Linux/Unix/FreeBSD]]></category>

		<category><![CDATA[10]]></category>

		<category><![CDATA[cgi]]></category>

		<category><![CDATA[gd]]></category>

		<category><![CDATA[nagios]]></category>

		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/07/01/solaris-10-nagios-and-gd-compile-issues</guid>
		<description><![CDATA[If you ever compile Nagios successfully on Solaris 10 (trust me, it&#8217;s a beast to get working properly), beware if you get the following errors:

[Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] ld.so.1: histogram.cgi: fatal
: libgd.so.2: open failed: No such file or directory, referer: 
https://nagiostest.domain.tld/nagios/side.html
[Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] Premature end of [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever compile Nagios successfully on Solaris 10 (trust me, it&#8217;s a beast to get working properly), beware if you get the following errors:</p>

<div class="wp_syntax"><div class="code"><pre class="text">[Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] ld.so.1: histogram.cgi: fatal
: libgd.so.2: open failed: No such file or directory, referer: 
https://nagiostest.domain.tld/nagios/side.html
[Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] Premature end of script heade
rs: histogram.cgi, referer: https://nagiostest.domain.tld/nagios/side.html
[Tue Jul 01 18:16:03 2008] [error] [client 192.168.0.100] ld.so.1: statusmap.cgi: fatal
: libgd.so.2: open failed: No such file or directory, referer: 
https://nagiostest.domain.tld/nagios/cgi-bin/status.cgi?hostgroup=all&amp;style=grid
[Tue Jul 01 18:16:03 2008] [error] [client 192.168.0.100] Premature end of script heade
rs: statusmap.cgi, referer: https://nagiostest.domain.tld/nagios/cgi-bin/status.cgi?hostg
roup=all&amp;style=grid</pre></div></div>

<p> <a href="http://www.chrisweldon.net/2008/07/01/solaris-10-nagios-and-gd-compile-issues#more-114" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/07/01/solaris-10-nagios-and-gd-compile-issues/feed</wfw:commentRss>
		</item>
		<item>
		<title>Solaris 10 and NFS</title>
		<link>http://www.chrisweldon.net/2008/05/29/solaris-10-and-nfs</link>
		<comments>http://www.chrisweldon.net/2008/05/29/solaris-10-and-nfs#comments</comments>
		<pubDate>Thu, 29 May 2008 20:23:48 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Linux/Unix/FreeBSD]]></category>

		<category><![CDATA[nfs]]></category>

		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/05/29/solaris-10-and-nfs</guid>
		<description><![CDATA[I&#8217;ve been getting our Solaris environment setup in the College of Architecture, and one of the things I quickly realized with zones is that I&#8217;m going to need to setup LDAP to have any sort of efficient way of managing user accounts. Once this was setup, I quickly realized the need for NFS to be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting our Solaris environment setup in the College of Architecture, and one of the things I quickly realized with zones is that I&#8217;m going to need to setup LDAP to have any sort of efficient way of managing user accounts. Once this was setup, I quickly realized the need for NFS to be setup and thought that it&#8217;d be fairly straight-forward to setup (like it is on Linux). This turned out to not be the case.<br />
 <a href="http://www.chrisweldon.net/2008/05/29/solaris-10-and-nfs#more-113" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/05/29/solaris-10-and-nfs/feed</wfw:commentRss>
		</item>
		<item>
		<title>VIM in Windows!? Whod&#8217;a thunk?</title>
		<link>http://www.chrisweldon.net/2008/04/01/vim-in-windows-whoda-thunk</link>
		<comments>http://www.chrisweldon.net/2008/04/01/vim-in-windows-whoda-thunk#comments</comments>
		<pubDate>Tue, 01 Apr 2008 13:56:49 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Linux/Unix/FreeBSD]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/04/01/vim-in-windows-whoda-thunk</guid>
		<description><![CDATA[A friend of mine passed over the following blog entry, which I found quite to my liking. J.P. Boodhoo (a leader in the .Net development community) has found some plugins and tools which enable vim in certain applications in Windows. Those being:

Visual Studio 2005/2008
Microsoft Word
Microsoft Outlook

Check out the article. It&#8217;s awesome.
]]></description>
			<content:encoded><![CDATA[<p>A friend of mine passed over the following blog entry, which I found quite to my liking. J.P. Boodhoo (a leader in the .Net development community) has found some plugins and tools which enable vim in certain applications in Windows. Those being:</p>
<ul>
<li>Visual Studio 2005/2008</li>
<li>Microsoft Word</li>
<li>Microsoft Outlook</li>
</ul>
<p>Check out <a href="http://www.jpboodhoo.com/blog/GettinJiggyWithVIM.aspx">the article</a>. It&#8217;s awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/04/01/vim-in-windows-whoda-thunk/feed</wfw:commentRss>
		</item>
		<item>
		<title>Generating an SSL Certificate</title>
		<link>http://www.chrisweldon.net/2008/03/28/generating-an-ssl-certificate</link>
		<comments>http://www.chrisweldon.net/2008/03/28/generating-an-ssl-certificate#comments</comments>
		<pubDate>Fri, 28 Mar 2008 14:51:47 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Administration]]></category>

		<category><![CDATA[Linux/Unix/FreeBSD]]></category>

		<category><![CDATA[certificate]]></category>

		<category><![CDATA[generate]]></category>

		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/03/28/generating-an-ssl-certificate</guid>
		<description><![CDATA[I remembered when I first started doing systems administration. One of the first (and simplest) things I had to do was learn how to generate a self-signed SSL certificate because I didn&#8217;t want to pay for one. Well, since my first time doing it, I&#8217;ve done the process about 2^18 times now, so it&#8217;s second [...]]]></description>
			<content:encoded><![CDATA[<p>I remembered when I first started doing systems administration. One of the first (and simplest) things I had to do was learn how to generate a self-signed SSL certificate because I didn&#8217;t want to pay for one. Well, since my first time doing it, I&#8217;ve done the process about 2^18 times now, so it&#8217;s second nature to me. But, to some folks who don&#8217;t want to read the lengthy explanation on what each step does, here&#8217;s a breakdown of what commands you&#8217;ll issue on a Linux server. Explanation about the steps will follow.</p>
<p> <a href="http://www.chrisweldon.net/2008/03/28/generating-an-ssl-certificate#more-111" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/03/28/generating-an-ssl-certificate/feed</wfw:commentRss>
		</item>
		<item>
		<title>Caching Problem</title>
		<link>http://www.chrisweldon.net/2008/03/27/caching-problem</link>
		<comments>http://www.chrisweldon.net/2008/03/27/caching-problem#comments</comments>
		<pubDate>Thu, 27 Mar 2008 16:14:02 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/03/27/caching-problem</guid>
		<description><![CDATA[Howdy all,
I made a post below relating to PHP, and the caching engine is not deleting the cache, so the post is showing up with &#60; and &#62; characters as literals, thus showing text boxes and other things that&#8217;s supposed to be straight code. Give it about 24 hours, and if it isn&#8217;t fixed, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Howdy all,</p>
<p>I made a post below relating to PHP, and the caching engine is not deleting the cache, so the post is showing up with &lt; and &gt; characters as literals, thus showing text boxes and other things that&#8217;s supposed to be straight code. Give it about 24 hours, and if it isn&#8217;t fixed, I&#8217;ll look into what&#8217;s causing the problems. </p>
<p><strong>Update (3/28/2008)</strong>: I thought it was a problem with wpsupercache, but in fact it wasn&#8217;t. It was a problem with the Wordpress plugin Google Code Prettify and/or something internal to Wordpress. I say this because my code snippets, which originally had &lt; and &gt; characters inline were rendering the HTML as literal HTML - not what I wanted. But when I figured that I&#8217;d change the snippets to use &amp;lt; and &amp;gt; instead, it _still_ got rendered as literal &lt; and &gt; characters. Weird - no? Well, check out the most previous post prior to this, and I&#8217;ll (hopefully) update my archives with the syntax used in the wp-syntax plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/03/27/caching-problem/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP Arrays in HTML</title>
		<link>http://www.chrisweldon.net/2008/03/27/php-arrays-in-html</link>
		<comments>http://www.chrisweldon.net/2008/03/27/php-arrays-in-html#comments</comments>
		<pubDate>Thu, 27 Mar 2008 15:55:48 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/03/27/php-arrays-in-html</guid>
		<description><![CDATA[One of my friends who has used PHP in the past, but hasn&#8217;t touched it in a while, recently asked me what the best was to handle mass edits and deletions on a page. To understand more what he&#8217;s talking about, he has a form with a table of data, each containing checkboxes in a [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friends who has used PHP in the past, but hasn&#8217;t touched it in a while, recently asked me what the best was to handle mass edits and deletions on a page. To understand more what he&#8217;s talking about, he has a form with a table of data, each containing checkboxes in a column labeled as <strong>Delete?</strong> He wants to know how he should handle the deleting multiple rows in a fast and efficient way. </p>
<p>How it may have been done (and you may be doing it right now) might look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;form</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;deleteCategories.php&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deleteCategory1&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span> Category 1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deleteCategory2&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span> Category 2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deleteCategory3&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span> Category 3<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/form<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php">    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'deleteCategory1'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'deleteCategory2'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'deleteCategory3'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The above code is highly inefficient, and if you&#8217;re dealing with database records, I honestly don&#8217;t see how your application would survive. You would have to add lines to deal with other records, which would make your application severely crippled, or extremely difficult to maintain - one of the two. </p>
<p>The solution to this is simple: use an &#8220;HTML Array&#8221;. When I say this, some people who have spent their lives working in HTML are going to say that HTML doesn&#8217;t have arrays. Of course they don&#8217;t. It&#8217;s PHP, though, that does. However, you have to pass to PHP the &#8220;array&#8221; in a certain fashion so that when it loads up it&#8217;s scripts, it knows its an array. Here&#8217;s how it works.</p>
<p>In PHP, arrays are usually written to and read from like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php">    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #0000ff;">$phpArray</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'key'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'subKeyPointsToValue'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">&quot;Some value&quot;</span>;
        <span style="color: #0000ff;">$phpValue</span> = <span style="color: #0000ff;">$phpArray</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'key'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'subKeyPointsToValue'</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
        <span style="color: #808080; font-style: italic;">// Iterating is generally done as follows:</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$phpArray</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$key</span> =&gt; <span style="color: #0000ff;">$subArray</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$subArray</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$subKey</span> =&gt; <span style="color: #0000ff;">$value</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;">// prints &quot;subKeyPointsToValue = Some value&quot;</span>
                <span style="color: #000066;">print</span> <span style="color: #0000ff;">$key</span>.<span style="color: #ff0000;">&quot; = &quot;</span>.<span style="color: #0000ff;">$value</span>; 
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>So, in HTML, how on earth do you do arrays? You don&#8217;t have an <array> element in HTML and you don&#8217;t have any array attributes for any tags. The key is in how you name your input cells:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;form</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;deleteCategories.php&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][]&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][]&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][]&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 3<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/form<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>What you see is I&#8217;ve named the checkbox fields the same name. In normal HTML land, this would be a no-no, and there&#8217;s a way to get around it if it doesn&#8217;t validate. That is, you simply switch to the following:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;form</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;deleteCategories.php&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][1]&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][2]&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete[category][3]&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>Category 3<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/form<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Now each checkbox has it&#8217;s own name and doesn&#8217;t overlap with others. We&#8217;ll consider the first HTML set case 1 and the second case 2. Here&#8217;s where the true PHP &#8220;magic&#8221; takes over and makes this a really powerful solution. You don&#8217;t have to then check and delete with the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php">    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'delete[category][1]'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span> <span style="color: #808080; font-style: italic;">// etc. for 2 and 3</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The above code is horrible. If you&#8217;re currently writing code like that above, slap yourself in the face with a nice wet fish. You&#8217;re about to get a rude awakening. Here&#8217;s how you&#8217;re actually going to use it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php">    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #808080; font-style: italic;">// Case 1</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'delete'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'category'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$id</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$id</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #808080; font-style: italic;">// Case 2</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'delete'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'category'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$id</span> =&gt; <span style="color: #0000ff;">$dontcare</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            deleteCategory<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$id</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>In either case, only the checkboxes that are selected come through as the array, but in either case, PHP converts what looks like a name with special characters in HTML to an actual PHP array. It&#8217;s very powerful and you can script code to handle what you need to and not have to worry about adding or changing it as your database grows.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/03/27/php-arrays-in-html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ahh! My entries!!! - Fixed</title>
		<link>http://www.chrisweldon.net/2008/02/28/ahh-my-entries</link>
		<comments>http://www.chrisweldon.net/2008/02/28/ahh-my-entries#comments</comments>
		<pubDate>Thu, 28 Feb 2008 22:49:51 +0000</pubDate>
		<dc:creator>Chris Weldon</dc:creator>
		
		<category><![CDATA[Random Rants]]></category>

		<guid isPermaLink="false">http://www.chrisweldon.net/2008/02/28/ahh-my-entries</guid>
		<description><![CDATA[Okay, so apparently things didn&#8217;t go as smoothly as I had thought they would when converting from Serendipity to Wordpress. Many of my posts took advantage of the &#8220;extended&#8221; posting feature (which basically required a user to click &#8220;Read More&#8221; and see the rest of my entry). However, the converter that I used did not [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so apparently things didn&#8217;t go as smoothly as I had thought they would when converting from Serendipity to Wordpress. Many of my posts took advantage of the &#8220;extended&#8221; posting feature (which basically required a user to click &#8220;Read More&#8221; and see the rest of my entry). However, the converter that I used did not convert these &#8220;extended&#8221; entries, so many of my posts are without content. I apologize for this, and look to getting them back up soon!</p>
<p><strong>Update (3/30/2008):</strong> I&#8217;ve restored all of my old extended entries, so they&#8217;re saved! Have fun reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisweldon.net/2008/02/28/ahh-my-entries/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
