Welcome Guest, Not a member yet? Register   Sign In
Disallowed Key Characters
#1

[eluser]Peter Lubambi[/eluser]
Hi all,
I am new to codeigniter. I always get this error 'Disallowed Key Characters' whenever I try to submit my form to save into the database. I have tried some solutions from net like deleting my cookies history but still I get the error.... any idea on how to get rid of this.
thanks in advance.
#2

[eluser]toopay[/eluser]
are you using the closing '?>' at controller or model? If yes, remove any of that (and whitespace after your very end line)
#3

[eluser]ClaudioX[/eluser]
Look if you're trying send a url with disallowed characters.
for exemplo:
"http://www.myurl.com/send_form/values/@>*&morethings;"
#4

[eluser]osci[/eluser]
in application/config.php

Code:
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs.  When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

you can permit more characters there but watch for DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
#5

[eluser]toopay[/eluser]
@Claudio & osci,

there is nothing to do with character beeing send in browser addressbar or 'config['permitted_uri_chars']. This error ussually means one thing : an extra line break. The line feed (LF) and carriage return (CR) characters (and their hex code equivalents ( and
) are forbidden in CodeIgniter’s framework.
#6

[eluser]toopay[/eluser]
their hex code equivalents
Code:
( and
)
are forbidden in CodeIgniter’s framework
#7

[eluser]ClaudioX[/eluser]
Hum, its possible @toopay, but when i get this error you mean, the usually mensage is something like: "the output already send", but better for @peter, he have more things to check.
#8

[eluser]InsiteFX[/eluser]
Take a look at the system/core/Input.php class and _clean_input_keys($str)

InsiteFX
#9

[eluser]toopay[/eluser]
if you send disallowed character in the browser address bar, it should generate an error like..
Quote:An Error Was Encountered

URI you submitted has disallowed character

'Disallowed Key Characters', an error which Peter face with, more probably because an extra line break OR... its generated by '_clean_input_key()' function in CodeIgniter Input Class (which means Peter send disallowed character in $_GET or $_POST variable, not URI), and as i stated above, there is nothing to do with character beeing send in browser addressbar or 'config['permitted_uri_chars'].
#10

[eluser]Peter Lubambi[/eluser]
Thanks everyone, it's true that I was sending disallowed characters on the smile, see these lines
$fname=array('name'=>'fname','id'=>'fname','type'=>'text');
echo "<p>First Name: ".form_input('$fname' Confusednake: )."</p><br />"; was supposed to be
echo "<p>First Name: ".form_input($fname)."</p><br />";




Theme © iAndrew 2016 - Forum software by © MyBB