CodeIgniter Forums
form field name="key[]" causes "Disallowed Character Keys" - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: form field name="key[]" causes "Disallowed Character Keys" (/showthread.php?tid=30826)



form field name="key[]" causes "Disallowed Character Keys" - El Forum - 05-27-2010

[eluser]skunkbad[/eluser]
I've got a series of form fields that must be posted as an array, but CI doesn't seem to like the square brackets. I'd hate to hack the input class. What's the deal with this type of form field?

Code:
<td>&lt;input type="text" name="whatever[]" value="" /&gt;&lt;/td>

It's just standard HTML.


form field name="key[]" causes "Disallowed Character Keys" - El Forum - 05-27-2010

[eluser]skunkbad[/eluser]
OK, just being stupid. For anyone trying to track down the key that is giving the Disallowed Key Chars error, just temporarily edit your input class on line 215ish:

Code:
function _clean_input_keys($str)
    {
        if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
        {
            echo $str;
            exit('Disallowed Key Characters.');
        }

        return $str;
    }

Then you actually get to SEE the error, which in my case was a dollar sign, and not the square brackets!