<?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: Debugging tip: &#8220;Disallowed Key Character&#8221; error in CodeIgniter</title>
	<atom:link href="http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/</link>
	<description>A web log about web development and internet culture with frequent detours into other stuff.</description>
	<lastBuildDate>Sun, 05 Sep 2010 03:25:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: matthewfedak</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-92176</link>
		<dc:creator>matthewfedak</dc:creator>
		<pubDate>Mon, 16 Aug 2010 16:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-92176</guid>
		<description>I just experienced this as I had a file name &lt;input type=&quot;text&quot; name=field&quot; /&gt; and was missing the first quote.</description>
		<content:encoded><![CDATA[<p>I just experienced this as I had a file name<br />
<input type="text" name=field" /> and was missing the first quote.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kalodont</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-92130</link>
		<dc:creator>kalodont</dc:creator>
		<pubDate>Mon, 12 Jul 2010 13:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-92130</guid>
		<description>This might be a bit off-topic, but might help someone seeking a solution for &quot;Disallowed Key Character&quot; in CI. The error may be also triggered by sending POST form data with POST array key names that contain &quot;non-english&quot; characters - I mean leters like ó or ń.</description>
		<content:encoded><![CDATA[<p>This might be a bit off-topic, but might help someone seeking a solution for &#8220;Disallowed Key Character&#8221; in CI. The error may be also triggered by sending POST form data with POST array key names that contain &#8220;non-english&#8221; characters &#8211; I mean leters like ó or ń.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Barnhardt</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-92126</link>
		<dc:creator>Glen Barnhardt</dc:creator>
		<pubDate>Fri, 02 Jul 2010 02:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-92126</guid>
		<description>Hi Tiffany,&lt;br&gt;&lt;br&gt;This error drove me nuts for quite some time. Even your suggestion didn&#039;t fix the problem. Here is what I did to find the issue.&lt;br&gt;&lt;br&gt;In the core CI code in system/libraries is a file called input.php I made a small modification to that file so that it would show the actual data in question.&lt;br&gt;&lt;br&gt;Around line number 199&lt;br&gt;&lt;br&gt;	function _clean_input_keys($str)&lt;br&gt;	{	&lt;br&gt;		 if ( ! preg_match(&quot;/^[a-z0-9:_/-]+$/i&quot;, $str))&lt;br&gt;		 {&lt;br&gt;			exit(&#039;Disallowed Key Characters: &#039;.$str);   // Added the variable to display.&lt;br&gt;		 }&lt;br&gt;&lt;br&gt;		return $str;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;I certainly hope this helps others.</description>
		<content:encoded><![CDATA[<p>Hi Tiffany,</p>
<p>This error drove me nuts for quite some time. Even your suggestion didn&#39;t fix the problem. Here is what I did to find the issue.</p>
<p>In the core CI code in system/libraries is a file called input.php I made a small modification to that file so that it would show the actual data in question.</p>
<p>Around line number 199</p>
<p>	function _clean_input_keys($str)<br />	{	<br />		 if ( ! preg_match(&#8220;/^[a-z0-9:_/-]+$/i&#8221;, $str))<br />		 {<br />			exit(&#39;Disallowed Key Characters: &#39;.$str);   // Added the variable to display.<br />		 }</p>
<p>		return $str;<br />	}</p>
<p>I certainly hope this helps others.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiffanybbrown</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-92046</link>
		<dc:creator>tiffanybbrown</dc:creator>
		<pubDate>Fri, 29 Jan 2010 23:27:56 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-92046</guid>
		<description>Vlad, delete *anything* after the closing ?&gt; -- including white space and line breaks -- or remove the ?&gt;.</description>
		<content:encoded><![CDATA[<p>Vlad, delete *anything* after the closing ?&gt; &#8212; including white space and line breaks &#8212; or remove the ?&gt;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vlad</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-92044</link>
		<dc:creator>Vlad</dc:creator>
		<pubDate>Mon, 25 Jan 2010 13:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-92044</guid>
		<description>WOW...........anyone here talk English :-?, like what button do I  press to get rid off the annoying &quot;Disallowed Key Characters&quot; there is obviously a solution, I just haven&#039;t found one in English yet, only in ITist&lt;br&gt;I get it while replying on Mercatornet, and that seem to be the only sight.</description>
		<content:encoded><![CDATA[<p>WOW&#8230;&#8230;&#8230;..anyone here talk English <img src='http://tiffanybbrown.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /> , like what button do I  press to get rid off the annoying &#8220;Disallowed Key Characters&#8221; there is obviously a solution, I just haven&#39;t found one in English yet, only in ITist<br />I get it while replying on Mercatornet, and that seem to be the only sight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-91741</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Sat, 14 Nov 2009 09:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-91741</guid>
		<description>I have experienced this error as well when I am in a hurry and forget to close my form tag </description>
		<content:encoded><![CDATA[<p>I have experienced this error as well when I am in a hurry and forget to close my form tag</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiffanybbrown</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-91707</link>
		<dc:creator>tiffanybbrown</dc:creator>
		<pubDate>Mon, 02 Nov 2009 17:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-91707</guid>
		<description>Thanks for restating what iBSpoof, manafta, and Ben all said above. White space errors are not CodeIgniter specific. PHP will display a &quot;Cannot send header&quot; error.  
 
&quot;Disallowed Key Character,&quot; however, IS the specific language CodeIgniter uses. That, in my opinion isn&#039;t as clear or familiar as the PHP error and can trip up users new to both. That&#039;s what this post is addressing. </description>
		<content:encoded><![CDATA[<p>Thanks for restating what iBSpoof, manafta, and Ben all said above. White space errors are not CodeIgniter specific. PHP will display a &quot;Cannot send header&quot; error.  </p>
<p>&quot;Disallowed Key Character,&quot; however, IS the specific language CodeIgniter uses. That, in my opinion isn&#039;t as clear or familiar as the PHP error and can trip up users new to both. That&#039;s what this post is addressing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Everett</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-91706</link>
		<dc:creator>Everett</dc:creator>
		<pubDate>Mon, 02 Nov 2009 17:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-91706</guid>
		<description>It&#039;s not just CodeIgniter... this is a &quot;feature&quot; of PHP.  It&#039;s best to leave off the closing tag unless it&#039;s required. </description>
		<content:encoded><![CDATA[<p>It&#039;s not just CodeIgniter&#8230; this is a &quot;feature&quot; of PHP.  It&#039;s best to leave off the closing tag unless it&#039;s required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiffany</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90860</link>
		<dc:creator>tiffany</dc:creator>
		<pubDate>Tue, 13 May 2008 14:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90860</guid>
		<description>@ben: but but... i like the ?&gt;. actually, if i unlearn the habit, i&#039;d probably wind up with the converse problem. i&#039;m weird like that. 

still, dropping the ?&gt; is a good way to prevent the problem. thanks for reiterating the point.

@markus: in CI, each key name in the data array becomes a variable. $data[&#039;foo&#039;] in your controller becomes $foo in your view. using a foreach loop seems unnecessary to me, unless you&#039;re returning multiple database rows.</description>
		<content:encoded><![CDATA[<p>@ben: but but&#8230; i like the ?>. actually, if i unlearn the habit, i&#8217;d probably wind up with the converse problem. i&#8217;m weird like that. </p>
<p>still, dropping the ?> is a good way to prevent the problem. thanks for reiterating the point.</p>
<p>@markus: in CI, each key name in the data array becomes a variable. $data['foo'] in your controller becomes $foo in your view. using a foreach loop seems unnecessary to me, unless you&#8217;re returning multiple database rows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Ramsey</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90858</link>
		<dc:creator>Ben Ramsey</dc:creator>
		<pubDate>Mon, 12 May 2008 04:42:37 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90858</guid>
		<description>Some others have already mentioned that the ?&gt; closing tag is not required, but I wanted to reiterate the point. In fact, as you have found, it can cause errors and unintended effects, particularly in library code (such as in a framework), because stray characters (line breaks, spaces, etc.) after the ?&gt; are echoed immediately. Thus, any code that sets a header later in the code (i.e. cookies, etc.) ends up being broken because headers cannot be set after content has been sent (echoed) to the client.

For this reason, it&#039;s a good practice to leave out the trailing ?&gt; closing tag when writing anything that&#039;s not specifically a view/template.

You can get around this, though, by turning on output buffering. :-)</description>
		<content:encoded><![CDATA[<p>Some others have already mentioned that the ?&gt; closing tag is not required, but I wanted to reiterate the point. In fact, as you have found, it can cause errors and unintended effects, particularly in library code (such as in a framework), because stray characters (line breaks, spaces, etc.) after the ?&gt; are echoed immediately. Thus, any code that sets a header later in the code (i.e. cookies, etc.) ends up being broken because headers cannot be set after content has been sent (echoed) to the client.</p>
<p>For this reason, it&#8217;s a good practice to leave out the trailing ?&gt; closing tag when writing anything that&#8217;s not specifically a view/template.</p>
<p>You can get around this, though, by turning on output buffering. <img src='http://tiffanybbrown.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90851</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Fri, 09 May 2008 18:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90851</guid>
		<description>While we&#039;re on the topic of CI (but a little off your original topic)... Tiffany, your original post on PHP Frameworks really inspired me to take a long hard look at Frameworks, and I wanted to first thank you for opening my eyes. I too decided to go with CI (and have yet to look back). My question is on output techniques. I am curious about how you output data from your models. Currently I pass the entire result set to my view via my controller. I then run a foreach statement in my view to output the results. I have no logical reason why I do this, but something tells me that its not the most efficient and effective way to use CI. What do you think?</description>
		<content:encoded><![CDATA[<p>While we&#8217;re on the topic of CI (but a little off your original topic)&#8230; Tiffany, your original post on PHP Frameworks really inspired me to take a long hard look at Frameworks, and I wanted to first thank you for opening my eyes. I too decided to go with CI (and have yet to look back). My question is on output techniques. I am curious about how you output data from your models. Currently I pass the entire result set to my view via my controller. I then run a foreach statement in my view to output the results. I have no logical reason why I do this, but something tells me that its not the most efficient and effective way to use CI. What do you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wenbert</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90849</link>
		<dc:creator>wenbert</dc:creator>
		<pubDate>Thu, 08 May 2008 05:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90849</guid>
		<description>the closing tag ?&gt; is not required. in fact, in Zend Framework, when doing .php files, it is encourage that you avoid it.</description>
		<content:encoded><![CDATA[<p>the closing tag ?&gt; is not required. in fact, in Zend Framework, when doing .php files, it is encourage that you avoid it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiffany</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90848</link>
		<dc:creator>tiffany</dc:creator>
		<pubDate>Wed, 07 May 2008 20:38:14 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90848</guid>
		<description>Thank you for pointing that out manafta. I&#039;ve experienced this before with other PHP projects as well. 

CodeIgniter, however, will output a specific &quot;Disallowed Key Characters&quot; error. If you don&#039;t know that line breaks will cause the error, it can be tricky to track down. PHP will usually report that it can&#039;t re-send headers.

I&#039;ve posted it here so that other CI users can learn about this specific cause and cure.</description>
		<content:encoded><![CDATA[<p>Thank you for pointing that out manafta. I&#8217;ve experienced this before with other PHP projects as well. </p>
<p>CodeIgniter, however, will output a specific &#8220;Disallowed Key Characters&#8221; error. If you don&#8217;t know that line breaks will cause the error, it can be tricky to track down. PHP will usually report that it can&#8217;t re-send headers.</p>
<p>I&#8217;ve posted it here so that other CI users can learn about this specific cause and cure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manafta</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90847</link>
		<dc:creator>manafta</dc:creator>
		<pubDate>Wed, 07 May 2008 19:15:30 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90847</guid>
		<description>The extra line break causes PHP to start outputting text (the line break). If your not supposed to output anything before a certain point, any application will fail. This is not codeigniter specific. Learned that the hard way.</description>
		<content:encoded><![CDATA[<p>The extra line break causes PHP to start outputting text (the line break). If your not supposed to output anything before a certain point, any application will fail. This is not codeigniter specific. Learned that the hard way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiffany</title>
		<link>http://tiffanybbrown.com/2008/05/06/debugging-tip-disallowed-key-character-error-in-codeigniter/comment-page-1/#comment-90846</link>
		<dc:creator>tiffany</dc:creator>
		<pubDate>Wed, 07 May 2008 17:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://tiffanybbrown.com/?p=1285#comment-90846</guid>
		<description>It&#039;s a force of coding habit, and a good one, IMO. The important thing to remember is that excess white space can cause CodeIgniter to chuck a wobbly.</description>
		<content:encoded><![CDATA[<p>It&#8217;s a force of coding habit, and a good one, IMO. The important thing to remember is that excess white space can cause CodeIgniter to chuck a wobbly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
