<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Gatekeeper In Perspective</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Mon, 15 Mar 2010 16:37:39 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Will Kessel</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4904</link>
		<dc:creator>Will Kessel</dc:creator>
		<pubDate>Tue, 01 Feb 2005 19:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4904</guid>
		<description>Eric,

There is another way, potentially, if you&#039;ll pardon my limited (but now growing) understanding of PHP: why not set, perhaps, 7 checkboxes, each with a designated color. Only 4 would have the proper colors. Have the user select only the green and the blue. Set the array with PHP -- then implode the array using the &lt;code&gt;implode()&lt;/code&gt; command to a single string and send that string to the handling script. Let PHP then parse the string. Right string: post; wrong string: send them to another site (maybe even their own IP).

Just a thought...</description>
		<content:encoded><![CDATA[<p>Eric,</p>
<p>There is another way, potentially, if you&#8217;ll pardon my limited (but now growing) understanding of PHP: why not set, perhaps, 7 checkboxes, each with a designated color. Only 4 would have the proper colors. Have the user select only the green and the blue. Set the array with PHP &#8212; then implode the array using the <code>implode()</code> command to a single string and send that string to the handling script. Let PHP then parse the string. Right string: post; wrong string: send them to another site (maybe even their own IP).</p>
<p>Just a thought&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: greg</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4846</link>
		<dc:creator>greg</dc:creator>
		<pubDate>Fri, 28 Jan 2005 18:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4846</guid>
		<description>Eric, perhaps my earlier e-mail should have also been a post - THANKS! Nothing more needs to be said.</description>
		<content:encoded><![CDATA[<p>Eric, perhaps my earlier e-mail should have also been a post &#8211; THANKS! Nothing more needs to be said.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Morrison</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4842</link>
		<dc:creator>John Morrison</dc:creator>
		<pubDate>Fri, 28 Jan 2005 06:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4842</guid>
		<description>Personally Eric i don&#039;t think people appreciate all you do, even if they don&#039;t like the idea they should get over themselves and enjoy that someone is doing something</description>
		<content:encoded><![CDATA[<p>Personally Eric i don&#8217;t think people appreciate all you do, even if they don&#8217;t like the idea they should get over themselves and enjoy that someone is doing something</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Reid</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4840</link>
		<dc:creator>Jamie Reid</dc:creator>
		<pubDate>Fri, 28 Jan 2005 04:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4840</guid>
		<description>Using the &lt;code&gt;name=&quot;blah[]&quot;&lt;/code&gt; &#039;trick&#039;, why not use the &lt;code&gt;count()&lt;/code&gt; function?

You iterate through the $_POST variables:
&lt;code&gt;
foreach ($_POST as $foo =&gt; $bar)
{
 if (count($bar) &gt; 1) { 
   //it&#039;s an array
 } else {
   //it&#039;s not an array
 }
}
&lt;/code&gt;

Here&#039;s an example I just whipped up to make sure I was right. I ran it as a script from the command line, but the ideas are the same:

&lt;code&gt;
        $monkies[0] = &#039;Bobo&#039;;
        $monkies[1] = &#039;George&#039;;

        $animals[&#039;dog&#039;] = &#039;Rex&#039;;
        $animals[&#039;cow&#039;] = &#039;Bessie&#039;;
        $animals[&#039;monkey&#039;] = $monkies;
        $animals[&#039;cat&#039;] = &#039;Spot&#039;;

        echo &#039;I have the following pets:&#039;.&quot;n&quot;;
        foreach ($animals as $theKey =&gt; $theValue) {
                if (count($theValue) &gt; 1) {
                        for ($i=0;$i&lt;count ($theValue);$i++) {
                                echo &#039;A &#039; . $theKey . &#039; named &#039; . $theValue[$i] . &quot;n&quot;;
                        }
                } else {
                        echo &#039;A &#039; . $theKey . &#039; named &#039; . $theValue . &quot;n&quot;;
                }
        }
&lt;/code&gt;

But yes, it would be easier if PHP just put the checkboxes as delimited text.</description>
		<content:encoded><![CDATA[<p>Using the <code>name="blah[]"</code> &#8216;trick&#8217;, why not use the <code>count()</code> function?</p>
<p>You iterate through the $_POST variables:<br />
<code><br />
foreach ($_POST as $foo => $bar)<br />
{<br />
 if (count($bar) > 1) {<br />
   //it's an array<br />
 } else {<br />
   //it's not an array<br />
 }<br />
}<br />
</code></p>
<p>Here&#8217;s an example I just whipped up to make sure I was right. I ran it as a script from the command line, but the ideas are the same:</p>
<p><code><br />
        $monkies[0] = 'Bobo';<br />
        $monkies[1] = 'George';</p>
<p>        $animals['dog'] = 'Rex';<br />
        $animals['cow'] = 'Bessie';<br />
        $animals['monkey'] = $monkies;<br />
        $animals['cat'] = 'Spot';</p>
<p>        echo 'I have the following pets:'."n";<br />
        foreach ($animals as $theKey => $theValue) {<br />
                if (count($theValue) > 1) {<br />
                        for ($i=0;$i&lt;count ($theValue);$i++) {<br />
                                echo 'A ' . $theKey . ' named ' . $theValue[$i] . "n";<br />
                        }<br />
                } else {<br />
                        echo 'A ' . $theKey . ' named ' . $theValue . "n";<br />
                }<br />
        }<br />
</code></p>
<p>But yes, it would be easier if PHP just put the checkboxes as delimited text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bookmarks</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4835</link>
		<dc:creator>bookmarks</dc:creator>
		<pubDate>Fri, 28 Jan 2005 00:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4835</guid>
		<description>&lt;strong&gt;Eric&#039;s Archived Thoughts: WP-Gatekeeper&lt;/strong&gt;
Eric&#039;s Archived Thoughts: WP-Gatekeeper (more, dl &amp; instructions)...</description>
		<content:encoded><![CDATA[<p><strong>Eric&#8217;s Archived Thoughts: WP-Gatekeeper</strong><br />
Eric&#8217;s Archived Thoughts: WP-Gatekeeper (more, dl &#038; instructions)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: randomfire</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4831</link>
		<dc:creator>randomfire</dc:creator>
		<pubDate>Thu, 27 Jan 2005 13:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4831</guid>
		<description>&lt;strong&gt;Form elements as PHP variables&lt;/strong&gt;
A discussion on how the requirement for brackets for form elements as a PHP array is actually quite useful....</description>
		<content:encoded><![CDATA[<p><strong>Form elements as PHP variables</strong><br />
A discussion on how the requirement for brackets for form elements as a PHP array is actually quite useful&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Meyer</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4826</link>
		<dc:creator>Eric Meyer</dc:creator>
		<pubDate>Thu, 27 Jan 2005 02:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4826</guid>
		<description>There are two reasons I wanted the real information, and wasn&#039;t satisfied to settle for just knowing that something worked without any information on why.

First, as you say, personal annoyance; HTML forms have long passed multiple-value results, and every other scripting language I&#039;ve ever used has been able to deal with that or at least make it possible to deal with it.  In fact, they would, absent any special handling, generally return a value something like &#039;cb02:cb04:cb05&#039; (using some kind of separator).  PHP appears to be either too dumb to understand that, or too &quot;smart&quot; to let it pass through untouched.  The latter approach, that of trying to be smarter than the user, being what Microsoft does all the time.

Second, if I&#039;m going to hack, I want to know exactly why the hack is necessary.  I don&#039;t use CSS hacks I don&#039;t understand, and I avoid using CSS hacks whenever possible.  The same goes for any other hack in any other language.  I will avoid hacks whenever I can, and only use them when I understand them.

Via IM, I got a pointer from JH: http://us4.php.net/manual/en/faq.html.php#faq.html.arrays .  That lead me to http://us4.php.net/manual/en/language.variables.external.php .  In the comments on the latter page, carl_steinhilber said (back in 2002):

&lt;blockquote&gt;
A group of identically-named checkbox form elements returning an array is a pretty standard feature of HTML forms. It would seem that, if the only way to get it to work is a non-HTML-standard-compliant workaround, it&#039;s a problem with PHP.  Since the array is passed in the header in a post, or the URL in a get, it&#039;s the PHP interpretation of those values that&#039;s failing.
&lt;/blockquote&gt;

He was wrong about the square-bracket workaround being non-compliant; it&#039;s acceptable to throw brackets into &lt;code&gt;name&lt;/code&gt; values.  Other than that, I agree with him 110%.

Regardless, that closes that case: if I want to use checkboxes or have the same name applied to multiple text boxes, I&#039;m going to have to use the square brackets.  Now---for anyone who is using WP-Gatekeeper or has looked at the code, and has feedback on the coding or the way it works for the administrator of a WP blog, I&#039;d like to hear from you.</description>
		<content:encoded><![CDATA[<p>There are two reasons I wanted the real information, and wasn&#8217;t satisfied to settle for just knowing that something worked without any information on why.</p>
<p>First, as you say, personal annoyance; HTML forms have long passed multiple-value results, and every other scripting language I&#8217;ve ever used has been able to deal with that or at least make it possible to deal with it.  In fact, they would, absent any special handling, generally return a value something like &#8216;cb02:cb04:cb05&#8242; (using some kind of separator).  PHP appears to be either too dumb to understand that, or too &#8220;smart&#8221; to let it pass through untouched.  The latter approach, that of trying to be smarter than the user, being what Microsoft does all the time.</p>
<p>Second, if I&#8217;m going to hack, I want to know exactly why the hack is necessary.  I don&#8217;t use CSS hacks I don&#8217;t understand, and I avoid using CSS hacks whenever possible.  The same goes for any other hack in any other language.  I will avoid hacks whenever I can, and only use them when I understand them.</p>
<p>Via IM, I got a pointer from JH: <a href="http://us4.php.net/manual/en/faq.html.php#faq.html.arrays" rel="nofollow">http://us4.php.net/manual/en/faq.html.php#faq.html.arrays</a> .  That lead me to <a href="http://us4.php.net/manual/en/language.variables.external.php" rel="nofollow">http://us4.php.net/manual/en/language.variables.external.php</a> .  In the comments on the latter page, carl_steinhilber said (back in 2002):</p>
<blockquote><p>
A group of identically-named checkbox form elements returning an array is a pretty standard feature of HTML forms. It would seem that, if the only way to get it to work is a non-HTML-standard-compliant workaround, it&#8217;s a problem with PHP.  Since the array is passed in the header in a post, or the URL in a get, it&#8217;s the PHP interpretation of those values that&#8217;s failing.
</p></blockquote>
<p>He was wrong about the square-bracket workaround being non-compliant; it&#8217;s acceptable to throw brackets into <code>name</code> values.  Other than that, I agree with him 110%.</p>
<p>Regardless, that closes that case: if I want to use checkboxes or have the same name applied to multiple text boxes, I&#8217;m going to have to use the square brackets.  Now&#8212;for anyone who is using WP-Gatekeeper or has looked at the code, and has feedback on the coding or the way it works for the administrator of a WP blog, I&#8217;d like to hear from you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Duff</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4823</link>
		<dc:creator>Michael Duff</dc:creator>
		<pubDate>Thu, 27 Jan 2005 01:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4823</guid>
		<description>Eric, as explain by Hadley above (very well i might add) these are needed, I just dont see the big deal? the html still validates, are there accessability issues? or just a personal annoyance?</description>
		<content:encoded><![CDATA[<p>Eric, as explain by Hadley above (very well i might add) these are needed, I just dont see the big deal? the html still validates, are there accessability issues? or just a personal annoyance?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hadley Wickham</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4820</link>
		<dc:creator>Hadley Wickham</dc:creator>
		<pubDate>Thu, 27 Jan 2005 01:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4820</guid>
		<description>Ok let&#039;s go back to basics - what does your browser send to meyerweb.com when you click submit on that form.  In the form tag, you&#039;ve said use method &quot;post&quot;, so the browser is going to create a http post request that looks something like this:  (many fields omitted for brevity, and defaults used)

checker=cb02
checker=cb04
checker=cb05

checker2[]=cb02
checker2[]=cb04
checker2[]=cb05

This is what PHP gets.  Now php has to decide how to take this post data and convert it into php variables.  It does this in a pretty straightforward manner, and will execute PHP code something like this:

$_POST[&#039;checker&#039;] = &#039;cb02&#039;
$_POST[&#039;checker&#039;] = &#039;cb04&#039;
$_POST[&#039;checker&#039;] = &#039;cb05&#039;

$_POST[&#039;checker2&#039;][] = &#039;cb02&#039;
$_POST[&#039;checker2&#039;][] = &#039;cb04&#039;
$_POST[&#039;checker2&#039;][] = &#039;cb05&#039;

Now do you see why you need those []?  Without them PHP assigns each checked value from &#039;checker&#039; to $checker, each value overwriting the previous.  When you add the [], php assumes you want an array that stores them all.  

I hope this explains more clearly what&#039;s going on.  The details may not be exactly correct, but I hope you get the gist of it.</description>
		<content:encoded><![CDATA[<p>Ok let&#8217;s go back to basics &#8211; what does your browser send to meyerweb.com when you click submit on that form.  In the form tag, you&#8217;ve said use method &#8220;post&#8221;, so the browser is going to create a http post request that looks something like this:  (many fields omitted for brevity, and defaults used)</p>
<p>checker=cb02<br />
checker=cb04<br />
checker=cb05</p>
<p>checker2[]=cb02<br />
checker2[]=cb04<br />
checker2[]=cb05</p>
<p>This is what PHP gets.  Now php has to decide how to take this post data and convert it into php variables.  It does this in a pretty straightforward manner, and will execute PHP code something like this:</p>
<p>$_POST['checker'] = &#8216;cb02&#8242;<br />
$_POST['checker'] = &#8216;cb04&#8242;<br />
$_POST['checker'] = &#8216;cb05&#8242;</p>
<p>$_POST['checker2'][] = &#8216;cb02&#8242;<br />
$_POST['checker2'][] = &#8216;cb04&#8242;<br />
$_POST['checker2'][] = &#8216;cb05&#8242;</p>
<p>Now do you see why you need those []?  Without them PHP assigns each checked value from &#8216;checker&#8217; to $checker, each value overwriting the previous.  When you add the [], php assumes you want an array that stores them all.  </p>
<p>I hope this explains more clearly what&#8217;s going on.  The details may not be exactly correct, but I hope you get the gist of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JH</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4819</link>
		<dc:creator>JH</dc:creator>
		<pubDate>Thu, 27 Jan 2005 00:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4819</guid>
		<description>&lt;a href=&quot;http://us4.php.net/manual/en/faq.html.php#faq.html.arrays&quot;&gt;It&#039;s documented behaviour&lt;/a&gt;, though as you correctly say, it shouldn&#039;t be necessary.

Just posting this here having passed it to Eric by IM, for the sake of anyone who&#039;s looking here for the answer.</description>
		<content:encoded><![CDATA[<p><a href="http://us4.php.net/manual/en/faq.html.php#faq.html.arrays">It&#8217;s documented behaviour</a>, though as you correctly say, it shouldn&#8217;t be necessary.</p>
<p>Just posting this here having passed it to Eric by IM, for the sake of anyone who&#8217;s looking here for the answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Burgin</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4818</link>
		<dc:creator>Keith Burgin</dc:creator>
		<pubDate>Thu, 27 Jan 2005 00:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4818</guid>
		<description>Obviously since scanned fingerprint identification is not an option at this point, then any method used to seperate visitors from spammers and spambots is going to be dependent upon the dedication of the spammers, no? They&#039;ll just figure out a way around any blockade we put up.  

Plus, it&#039;s just plain silly to go to the effort of installing a biometric ID system on your server, and even sillier to expect your readers to purchase a thumb scanner (priced anywhere from $57.00 to $460.00 depending on the quality) and hook it up just to comment.

However, for little or no money per person, the problem could be solved immediately and forever.  Here&#039;s what you need:

&lt;ul&gt;
&lt;li&gt;Ziploc baggy (preferably one of those with the little square zip thingy on top - I hear they close with less effort)&lt;/li&gt;
&lt;li&gt;Pre-printed, liquid resistant ID sticker with a name and number 1-10, i.e.: Keith Burgin - 1&lt;/li&gt;
&lt;li&gt;Padded mailing envelope (you know, the puffy ones)&lt;/li&gt;
&lt;li&gt;Propane torch&lt;/li&gt;
&lt;li&gt;Kitchen knife (sharp - believe me, you&#039;re gonna want it sharp)&lt;/li&gt;
&lt;/ul&gt;

Okay.  Eric makes his comment area with one extra text input field for the name and ID number (the aformentioned &quot;Keith Burgin - 1&quot; corresponding to your comment.

You look at the ID number on your current label, type that in, and send your comment.  Don&#039;t look for it to be up for a couple of days, this takes a bit of time to sort out.

Once you&#039;ve sent your comment, take the ID sticker and wrap it around the finger of your choice.  Hack that baby off with the kitchen knife, seal the stub with the propane torch, seal the finger in the Ziploc bag, slide that in the padded envelope and mail it off to Eric.

Once Eric gets the finger, he simply matches the ID tag to your comment and approves the comment.  Simple, no?

Spammers are not dedicated enough to use this system - I can guarantee that.  Of course it will cut down on the number of legitimate comments, since an individual will only be able to do this ten times.  Of course, you could always use toes, but let&#039;s be a little sympathetic to Eric, people.  Who wants to get a toe in the mail?  I mean, really...

Any takers?</description>
		<content:encoded><![CDATA[<p>Obviously since scanned fingerprint identification is not an option at this point, then any method used to seperate visitors from spammers and spambots is going to be dependent upon the dedication of the spammers, no? They&#8217;ll just figure out a way around any blockade we put up.  </p>
<p>Plus, it&#8217;s just plain silly to go to the effort of installing a biometric ID system on your server, and even sillier to expect your readers to purchase a thumb scanner (priced anywhere from $57.00 to $460.00 depending on the quality) and hook it up just to comment.</p>
<p>However, for little or no money per person, the problem could be solved immediately and forever.  Here&#8217;s what you need:</p>
<ul>
<li>Ziploc baggy (preferably one of those with the little square zip thingy on top &#8211; I hear they close with less effort)</li>
<li>Pre-printed, liquid resistant ID sticker with a name and number 1-10, i.e.: Keith Burgin &#8211; 1</li>
<li>Padded mailing envelope (you know, the puffy ones)</li>
<li>Propane torch</li>
<li>Kitchen knife (sharp &#8211; believe me, you&#8217;re gonna want it sharp)</li>
</ul>
<p>Okay.  Eric makes his comment area with one extra text input field for the name and ID number (the aformentioned &#8220;Keith Burgin &#8211; 1&#8243; corresponding to your comment.</p>
<p>You look at the ID number on your current label, type that in, and send your comment.  Don&#8217;t look for it to be up for a couple of days, this takes a bit of time to sort out.</p>
<p>Once you&#8217;ve sent your comment, take the ID sticker and wrap it around the finger of your choice.  Hack that baby off with the kitchen knife, seal the stub with the propane torch, seal the finger in the Ziploc bag, slide that in the padded envelope and mail it off to Eric.</p>
<p>Once Eric gets the finger, he simply matches the ID tag to your comment and approves the comment.  Simple, no?</p>
<p>Spammers are not dedicated enough to use this system &#8211; I can guarantee that.  Of course it will cut down on the number of legitimate comments, since an individual will only be able to do this ten times.  Of course, you could always use toes, but let&#8217;s be a little sympathetic to Eric, people.  Who wants to get a toe in the mail?  I mean, really&#8230;</p>
<p>Any takers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Meyer</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4817</link>
		<dc:creator>Eric Meyer</dc:creator>
		<pubDate>Thu, 27 Jan 2005 00:27:22 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4817</guid>
		<description>So much for managing community direction.

Here&#039;s a test case: http://meyerweb.com/eric/php/formtest.html

You&#039;ll note that it contains form elements that have defined values, some of which share names, and others of which do not.  When the form is submitted, the result is that the last value in each name-group that doesn&#039;t have brackets is read; anything before it in that group is dropped.  Now, if I add the square brackets to the names in the XHTML, PHP suddenly wakes up and handles things correctly.  Without them, it doesn&#039;t.

So does anyone know how to make PHP handle HTTP form data correctly without the square-bracket hack, which should not be needed?  No guesses; I said does anyone &lt;em&gt;know&lt;/em&gt; either how to fix PHP sans hacks, or else exactly why it&#039;s acting this way.</description>
		<content:encoded><![CDATA[<p>So much for managing community direction.</p>
<p>Here&#8217;s a test case: <a href="http://meyerweb.com/eric/php/formtest.html" rel="nofollow">http://meyerweb.com/eric/php/formtest.html</a></p>
<p>You&#8217;ll note that it contains form elements that have defined values, some of which share names, and others of which do not.  When the form is submitted, the result is that the last value in each name-group that doesn&#8217;t have brackets is read; anything before it in that group is dropped.  Now, if I add the square brackets to the names in the XHTML, PHP suddenly wakes up and handles things correctly.  Without them, it doesn&#8217;t.</p>
<p>So does anyone know how to make PHP handle HTTP form data correctly without the square-bracket hack, which should not be needed?  No guesses; I said does anyone <em>know</em> either how to fix PHP sans hacks, or else exactly why it&#8217;s acting this way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Duff</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4816</link>
		<dc:creator>Michael Duff</dc:creator>
		<pubDate>Thu, 27 Jan 2005 00:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4816</guid>
		<description>but if you have a question like &quot;check blue and red&quot; you count the array, if its less or greater then 2 then deny it, the do a loop to make  sure both values actually match one of the answers, this might prove easier or harder depending on how you are useto coding.</description>
		<content:encoded><![CDATA[<p>but if you have a question like &#8220;check blue and red&#8221; you count the array, if its less or greater then 2 then deny it, the do a loop to make  sure both values actually match one of the answers, this might prove easier or harder depending on how you are useto coding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neal Lindsay</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4815</link>
		<dc:creator>Neal Lindsay</dc:creator>
		<pubDate>Thu, 27 Jan 2005 00:07:33 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4815</guid>
		<description>The complex part of this issue is that http only sends the info for the checked boxes. That means you can&#039;t have a bunch of value-less checkboxes like this:
&lt;code&gt;&lt;input type=&quot;checkbox&quot; name=&quot;inputname[]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[]&quot; /&gt;&lt;/code&gt;
and know in the end which boxes have been checked. (You would only end up knowing how many had been checked, but not which ones exactly.)

You need to either give each of them a unique value or explicitly say their location in the array within the name field like so:
&lt;code&gt;&lt;input type=&quot;checkbox&quot; name=&quot;inputname[0]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[1]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[2]&quot; /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;inputname[3]&quot; /&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The complex part of this issue is that http only sends the info for the checked boxes. That means you can&#8217;t have a bunch of value-less checkboxes like this:<br />
<code>&lt;input type="checkbox" name="inputname[]" /&gt;<br />
&lt;input type="checkbox" name="inputname[]" /&gt;<br />
&lt;input type="checkbox" name="inputname[]" /&gt;<br />
&lt;input type="checkbox" name="inputname[]" /&gt;</code><br />
and know in the end which boxes have been checked. (You would only end up knowing how many had been checked, but not which ones exactly.)</p>
<p>You need to either give each of them a unique value or explicitly say their location in the array within the name field like so:<br />
<code>&lt;input type="checkbox" name="inputname[0]" /&gt;<br />
&lt;input type="checkbox" name="inputname[1]" /&gt;<br />
&lt;input type="checkbox" name="inputname[2]" /&gt;<br />
&lt;input type="checkbox" name="inputname[3]" /&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Duff</title>
		<link>http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4814</link>
		<dc:creator>Michael Duff</dc:creator>
		<pubDate>Wed, 26 Jan 2005 23:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comment-4814</guid>
		<description>eric, I did a quick test for you and this html

&lt;code&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;checkbox[]&quot; value=&quot;checkbo1x&quot;&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;checkbox[]&quot; value=&quot;checkbox2&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;
&lt;/code&gt;

produced this

&lt;code&gt;
Array ( [checkbox] =&gt; Array ( [0] =&gt; checkbo1x [1] =&gt; checkbox2 ) [Submit] =&gt; Submit )
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>eric, I did a quick test for you and this html</p>
<p><code><br />
&lt;input type=&quot;checkbox&quot; name=&quot;checkbox[]&quot; value=&quot;checkbo1x&quot;&gt;<br />
&lt;input type=&quot;checkbox&quot; name=&quot;checkbox[]&quot; value=&quot;checkbox2&quot;&gt;<br />
&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;<br />
</code></p>
<p>produced this</p>
<p><code><br />
Array ( [checkbox] => Array ( [0] => checkbo1x [1] => checkbox2 ) [Submit] => Submit )<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head profile="http://gmpg.org/xfn/1">
<title>meyerweb.com</title>
<link rel="openid.server" href="http://www.myopenid.com/server">
<link rel="openid.delegate" href="http://emeyer.myopenid.com/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="shortcut icon" href="/favicon.ico"><link rel="home" href="http://meyerweb.com/" title="Home" ><link rel="stylesheet" href="http://meyerweb.com/ui/meyerweb.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="http://meyerweb.com/ui/theme.css" type="text/css" media="screen, projection" id="themeLink"><link rel="stylesheet" href="http://meyerweb.com/ui/print.css" type="text/css" media="print"><script src="http://meyerweb.com/ui/addresses.js" type="text/javascript"></script><link rel="stylesheet" href="/ui/wordpress.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/tfe.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/home.css" type="text/css" media="screen">
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric" href="/eric/thoughts/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only technical posts)" href="/eric/thoughts/category/tech/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only personal posts)" href="/eric/thoughts/category/personal/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Distractions" href="/eric/thoughts/recent-links/rss2" />
<link rel="alternate" type="application/rss+xml" title="Excuse of the Day" href="/feeds/excuse/rss20.xml" />
</head>
<body id="www-meyerweb-com" class="hpg">

<div id="sitemast"><h1><a href="/"><span>meyerweb</span>.com</a></h1></div><div id="search"><h4>Exploration</h4><!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><div><input type="hidden" name="domains" value="meyerweb.com"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input><p><input type="radio" name="sitesearch" value="meyerweb.com" checked id="ss1"></input><label for="ss1" title="Search meyerweb.com">meyerweb.com</label><input type="radio" name="sitesearch" value="" id="ss0"></input><label for="ss0" title="Search the Web">Web</label></p><input type="hidden" name="client" value="pub-3772084027748653"></input><input type="hidden" name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input><input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="safe" value="active"></input><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input><input type="hidden" name="hl" value="en"></input></div></form><!-- SiteSearch Google --><!-- <form method="get" action="http://www.google.com/custom"><div><input type="submit" name="sa" value="Search"><input type="text" name="q" size="20" maxlength="255" value=""><input type="hidden" name="sitesearch" value="meyerweb.com"></div></form><small><a href="http://www.google.com/search">Powered by Google</a></small> --></div><div id="main"><div class="skipper">Skip to: <a href="#extra">site navigation/presentation</a></div><div class="skipper">Skip to: <a href="#thoughts">Thoughts From Eric</a></div>
<div id="thoughts">


<div class="entry">
<h3><a href="http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/" rel="bookmark" title="Permanent Link: Gatekeeper In Perspective">Gatekeeper In Perspective</a></h3>
<ul class="meta">
<li class="date">Wed 26 Jan 2005</li>
<li class="time">1620</li>
<li class="cat"><a href="http://meyerweb.com/eric/thoughts/category/tech/tools/" title="View all posts in Tools" rel="category tag">Tools</a><br> <a href="http://meyerweb.com/eric/thoughts/category/tech/wordpress/" title="View all posts in WordPress" rel="category tag">WordPress</a></li>
<li class="cmt"><a href="http://meyerweb.com/eric/thoughts/2005/01/26/gatekeeper-in-perspective/#comments">26 responses</a></li>
<li></li><li></li></ul>

<div class="text">
<p>
So when I <a href="http://meyerweb.com/eric/thoughts/2005/01/24/wp-gatekeeper/" title="WP-Gatekeeper">said on Monday</a>:
</p>

<blockquote>Got feedback?  Let&#8217;s hear it?</blockquote>

<p>
&#8230;what I actually meant was:
</p>

<blockquote>Got feedback about the code or how the package works once it&#8217;s installed in WordPress?  Let&#8217;s hear it.</blockquote>

<p>
I should have realized that otherwise, the comments would turn into an argument about comment spam, fighting it, ways the general idea could be defeated, and more.  Which they did.
</p>
<p>
Look, folks, despite what some people might tell you, I&#8217;m not so arrogant as to think that I could single-handedly solve the comment spamming problem for all time.  Even if I were, I very much doubt I&#8217;d be so clueless as to think that <a href="/eric/tools/wordpress/wp-gatekeeper.html" title="WP-Gatekeeper">WP-Gatekeeper</a> was that solution.  And if both those things were the case, I&#8217;m pretty darned near certain I would have very explicitly made the claim of having beaten the spammers.  Likely in big, boldfaced, red, capitalized, blinking letters, plus a background MIDI of &#8220;We Are The Champions&#8221;.
</p>
<p>
WP-Gatekeeper is not going to stop every possible comment spam attack, human or automated, for the rest of time.  Neither is any other defense you can name, <em>without exception</em>.  There may be measures that currently have 100% resistance to scripted attacks.  They will one day fail&mdash;I can pretty much guarantee it.  Even today, they are defeatable by actual humans sitting at computers and posting comment spam on every site they find.  That kind of spamming is very, very rare, but it happens.  I had such an incident within the last month.  If I hadn&#8217;t been keeping a close eye on new comments just then, I&#8217;d likely have missed it completely.
</p>
<p>
I&#8217;m fully aware that there are ways a spambot could defeat WP-Gatekeeper.  At the moment, none of them can.  That will one day change, of course, assuming challenges become at all popular.  Comment spam and the fighting thereof is a dance, a tennis match, an arms race.  Neither side will ever win.  As one side adopts a new tactic, the other side will move to counter it.  The countermeasure will itself be countered.  And so it goes.  Eventually, either spambots or spam defenses (or the two in combination) will become so advanced that they&#8217;ll gain self-awareness, and then we&#8217;ll all be royally hosed.
</p>
<p>
<em>I</em> know this.  <em>You</em> know this.  Let&#8217;s move on from there, okay?
</p>
<p>
In the end, the goal is to add another arrow to the quiver at the disposal of spam fighters.  Think this approach is wrongheaded, annoying, or otherwise pointless?  Fine.  Don&#8217;t use it.  For those who want to add this kind of capability&mdash;and since I instituted it on meyerweb, I&#8217;ve had not a single piece of spam make it onto the site or hit the moderation queue, whereas in my pre-defense days, I&#8217;d get at least twenty every day&mdash;then the package is there.  You can combine it with other defenses, if you like, for even more coverage.  I may upgrade it in the future, depending how far I get in learning PHP, mySQL, and form handling, and what feedback I get from people who know PHP better than I do.  I may not, in which case the system as it stands is effective, and probably will be for a while.  Even if I do one day abandon further development, the code is out there for someone else to improve if they so choose.
</p>
<p>
In the meantime, if there&#8217;s anyone who is using WP-Gatekeeper or has looked at the code, and has feedback on the coding or the way it works for the administrator of a WP blog, please feel free to share.  Also, if anyone can point me to an example of PHP code for collecting all of the HTTP_VARS that are returned by an XHTML form and then looking through them, even when the variable names aren&#8217;t necessarily known ahead of time, I&#8217;d really like to see it.  Thanks.
</p></div>

</div>

</div>
<p style="font-size: 90%; text-align: right; margin-top: 0.5em; padding-top: 0;">(If you care, there's even an <a href="/eric/thoughts/page/2/">archive of previous thoughts</a>...)</p>

</div><div id="extra"><div class="panel" id="archipelago"><h4>Identity Archipelago</h4><ul><li><a href="http://flickr.com/photos/meyerweb/" rel="me">Flickr</a></li><li><a href="http://twitter.com/meyerweb/" rel="me">Twitter</a></li><li><a href="http://dopplr.com/traveller/meyerweb">Dopplr</a></li><li><a href="http://www.linkedin.com/in/meyerweb" rel="me">LinkedIn</a></li><li><a href="http://technorati.com/profile/emeyer" rel="me">Technorati</a></li></ul></div><div class="panel" id="pointers"><h4>Projects Elsewhere</h4><ul><li><a href="http://aneventapart.com/">An Event Apart</a></li><li><a href="http://complexspiral.com/">Complex Spiral Consulting</a></li><li><a href="http://www.webassist.com/go/css/emeyer/">CSS Sculptor</a></li><li><a href="http://css-discuss.org/">css-discuss</a></li><li><a href="http://microformats.org/">Microformats</a></li><li><a href="http://s5project.org/">S5</a></li></ul></div><div class="panel" id="tour"><ul><li><a href="http://fray.com/issue3/"><img src="http://fray.com/images/i3c.gif" alt="Fray Contributor (Issue 3: Sex &amp; Death)" /></a></li><!-- <li><a href="http://www.webassist.com/go/css/emeyer/"><img src="/pix/CS_ad_180x109.jpg" alt="CSS Sculptor for Dreamweaver" style="max-width: 100%;" /></a></li> --></ul></div><div class="panel">
<h4>Recently Tweeted</h4>
<p class="more"><a href="http://twitter.com/meyerweb">see more</a></p>
<p>Due to a known bug (#516477), Thunderbird's Dock icon doubles the number of unread messages.  Ironically, I think that's rather odd. <small>&#8211;tweeted 8 hours, 7 minutes ago</small></p>
</div><div id="sideblog" class="panel">
<h4>Distractions</h4>
<p class="more">
<a href="/eric/thoughts/recent-links/">archive</a>
</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=nFicqklGuB0&amp;feature=player_embedded" title="March 12 | Wry comment expressing my appreciation of the creative derivativeness of this video and its uncanny accuracy in mocking common tropes.">Academy Award Winning Movie Trailer</a></li>
<li><a href="http://www.youtube.com/watch?v=414TmP12WAU" title="March 9 | &#8220;Apple juice&#8230; for half price!&#8221;  More like twice PRICELESS.  (Note: If you&#8217;re at work, don your headphones.)">Happy in Paraguay</a> <small>[via <a href="http://unstoppablerobotninja.com/">Ethan</a>]</small></li>
<li><a href="http://www.youtube.com/watch?v=9V5ubAOeOBk&amp;feature=player_embedded" title="February 10 | This is approximately the best thing ever.">U900 -Walk Don&#8217;t Run (Isogabamaware)</a></li>
<li><a href="http://www.456bereastreet.com/archive/201002/sifr_default_css_hides_content_from_at_least_one_screen_reader/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A 456bereastreet %28456 Berea Street%29" title="February 8 | -9999px comes through again, but I really wish we were beyond that kind of thing.">sIFR default CSS hides content from at least one screen reader</a></li>
<li><a href="http://www.macosxhints.com/article.php?story=20100117064356428" title="February 8 | Storing this for future use.">Take a picture with the iSight camera when a folder is opened</a></li>
<li><a href="http://mingle2.com/blog/view/web-developer-mind" title="February 4 | Mostly valid.  (SEE WHAT I DID THERE?)">The Mind of a Web Developer: An Illustrated Diagram</a></li>
<li><a href="http://www.theonion.com/content/news/science_channel_refuses_to_dumb" title="January 28 | &#8220;Punkin Chunkin, for Christ&#8217;s sake&#8230; What more do you people want?&#8221;">Science Channel Refuses To Dumb Down Science Any Further</a></li>
<li><a href="http://www.mailchimp.com/blog/project-omnivore-declassified/" title="January 27 | Sounds like quite a feat.  But I wonder how we&#8217;d feel if Microsoft or Google announced the same kind of thing on their e-mail services.">MailChimp&#8217;s Project Omnivore: Declassified</a></li>
<li><a href="http://www.politifact.com/truth-o-meter/statements/2010/jan/25/carolyn-maloney/congresswoman-says-democratic-presidents-create-mo/" title="January 26 | &#8220;Obviously, luck matters a lot, but when there is a consistent pattern over more than 60 years, it starts to look like more than just luck.&#8221;">Congresswoman says Democratic presidents create more private-sector jobs</a></li>
<li><a href="http://www.ted.com/talks/taylor_mali_what_teachers_make.html" title="January 25 | Truth.">Taylor Mali: What teachers make</a></li>
<li><a href="http://notebook.johnmartz.com/how-websites-work?c=1" title="January 22 | At last, the truth is out and I can stop pretending:  beatific monkeys are what makes it all go.">How websites work</a></li>
<li><a href="http://morsecode.scphillips.com/jtranslator.html" title="January 22 | &#8211; &#8230;. .. &#8230; / .. &#8230; / .- .&#8211; . &#8230; &#8212; &#8212; . / -. &#8212; / &#8230; . .-. .. &#8212; ..- &#8230; .-.. -.&#8211;">Morse Code Translator</a></li>
<li><a href="http://bengoldacre.posterous.com/did-aliens-play-a-role-in-woolworths" title="January 19 | I think the answer is clear to any who have the courage to see it.">Did aliens play a role in Woolworths?</a></li>
</ul>
</div>
<div class="panel" id="advisory">
<div class="guarded">
<a href="http://blogadvisorysystem.com/"><img src="/pix/bas/guarded.png" alt="Blog Advisory System Alert Level: Guarded"></a>
</div>
</div>

<div class="panel" id="excuse">
<h4>The <a href="/feeds/excuse/">excuse of the day</a> is</h4>
<p>cats</p>
</div>

<div class="panel" id="extras">
<h4>Extras</h4>
<ul>
<li><a href="/feeds/">Feeds</a> &#8226;</li>
<li><a href="/eric/faq.html">FAQ</a> &#8226;</li>
<li><a href="/family.html">Family</a></li>
</ul>
</div>

</div>

<div id="navigate">
<h4>Navigation</h4>
<ul id="navlinks">
<li id="archLink"><a href="/eric/thoughts/">Archives</a></li>
<li id="cssLink"><a href="/eric/css/">CSS</a></li>
<li id="toolsLink"><a href="/eric/tools/">Toolbox</a></li>
<li id="writeLink"><a href="/eric/writing.html">Writing</a></li>
<li id="speakLink"><a href="/eric/talks/">Speaking</a></li>
<li id="otherLink"><a href="/other/">Leftovers</a></li>
<li id="aboutsite"><a href="/ui/about.html">About this site</a></li>
</ul>
</div>

<div id="footer">
<p class="sosumi">All contents of this site, unless otherwise noted, are &copy;1995-2008 <strong>Eric A. and Kathryn S. Meyer</strong>.  All Rights Reserved.</p>
<p>"<a href="/eric/thoughts/">Thoughts From Eric</a>" is powered by the &uuml;bercool <a href="http://wordpress.org/">WordPress</a></p>
</div>
</body>
</html>
