<?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/index.php?year=2005&#038;monthnum=01&#038;day=26&#038;name=gatekeeper-in-perspective&#038;feed=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>Thu, 24 May 2012 19:21:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<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>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
