EllisLab text mark
Advanced Search
     
Disallawed characters in a form
Posted: 05 September 2007 08:32 PM   [ Ignore ]
Joined: 2006-01-23
15 posts

hi, i’ve build a form using the from Helper, it displays ok and it works fine until a submit that form.
i’ve changes the input library and added a $str to the exit function so i can see what are the characters ( exit(‘Disallowed Key Characters: ‘. $str); ).
every time i submit the form it says: Disallowed Key Characters: Array
and i cant figure out why, it all seems to be ok.
here’s the form code:

<div id="arch">
    <
div id="holder">
<?php
// constroi array de anos
$actual date('Y');
$anos = array();
for(
$i=0;$i<10;$i++){
    
    $anos[$i] 
$actual +$i;    
}

//constroi array cidades
$towns=array();
for(
$e=0;$e<count($cidades);$e++){
    $towns[$cidades[$e][
'id']] $cidades[$e]['nome'];
}

//constroi array tipo de cliente
$ctipo=array();
for(
$i=0;$i<count($tipocliente);$i++){
    $ctipo[$tipocliente[$i][
'id']] $tipocliente[$i]['tipo'];
}
//constroi array categorias
$categorias=array();

for(
$i=0;$i<count($cats);$i++){
    $categorias[$cats[$i][
'id']] $cats[$i]['Catnome'];
}

$data 
= Array(
                
=> array(
                              
'name'        => 'codigo_cliente',
                              
'id'          => 'codigo_cliente',
                              
'maxlength'   => '100',
                              
'size'        => '50',
                              
'style'       => 'width:50%'
                              
),
                 
=> array('name'        => 'nome',
                              
'id'          => 'nome',
                              
'maxlength'   => '100',
                              
'size'        => '50',
                              
'style'       => 'width:50%'),
                              
                 
=> array('name'        => 'idade',
                              
'id'          => 'idade',
                              
'maxlength'   => '100',
                              
'size'        => '50',
                              
'style'       => 'width:50%'),
                              
                 
=> array('name'        => 'email',
                              
'id'          => 'email',
                              
'maxlength'   => '100',
                              
'size'        => '50',
                              
'style'       => 'width:50%'),
                              
                 
=> array('name'        => 'telefone',
                              
'id'          => 'telefone',
                              
'maxlength'   => '100',
                              
'size'        => '50',
                              
'style'       => 'width:50%'),
                              
                 
=> array('name'        => 'description',
                              
'id'          => 'description',
                              
'rows'        => '15',
                              
'cols'        => '100',
                              
'style'       => 'width:100%'),
                              
                 
=> array('name'        => 'dia',
                              
'id'          => 'dia',
                              
'maxlength'   => '2',
                              
'size'        => '3'),
                              
                 
=> array(
                              
'name'        => 'active',
                              
'id'          => 'active',
                              
'value'       => '1',
                              
'checked'     => TRUE,
                              
'style'       => 'margin:10px')
);
                               
$meses = array('01'=>'Janeiro',
                
'02'=>'Fevereiro',
                
'03'=>'Mar&ccedil;o',
                
'04'=>'Abril',
                
'05'=>'Maio',
                
'06'=>'Junho',
                
'07'=>'Julho',
                
'08'=>'Agosto',
                
'09'=>'Setembro',
                
'10'=>'Outubro',
                
'11'=>'Novembro',
                
'12'=>'Dezembro');
                
    echo 
form_open('admin/insert_client');
        echo 
"c&oacute;digo cliente: <br />".form_input($data[1]."<br />");
        echo 
"nome: <br />".form_input($data[2]."<br />");
        echo 
"idade: <br />".form_input($data[3]."<br />");
        echo 
"email: <br />".form_input($data[4]."<br />");
        echo 
"telefone: <br />".form_input($data[5]."<br />");
        echo 
"descri&ccedil;&atilde;o: <br />"form_textarea($data[6])."<br />";
        echo 
"validade: <br />"form_input($data[7]) ." "form_dropdown('mes'$meses'01') ." "form_dropdown('ano'$anos$actual) ."<br />";
        echo 
"tpo de cliente: <br />"form_dropdown('ctipo'$ctipo'01') ."<br />";
        echo 
"categoria: <br />"form_dropdown('cat_id'$categorias'01') ."<br />";
        echo 
"cidade: <br />"form_dropdown('cid_id'$towns'01') ."<br />";
        echo 
"activo: "form_checkbox('active','active',TRUE) ."<br />";
        echo 
form_submit('submit''Submit Post');
        echo 
"</form>"//form_close();

?>
</div></div

can you tell me whats wrong?
thanks in advance

 
Posted: 05 September 2007 08:46 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-23
370 posts

You’re putting “
” tags inside the form_input()‘s. Should they not be _after_ the form_inputs()?

 Signature 

Mac OS X 10.8, Apache 2.x, NGiNX, PHP 5.4.x, CodeIgniter 1.7.2/2.1.3

 
Posted: 06 September 2007 05:35 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2006-01-23
15 posts

hey, thanks… that was so lame of me…
When you work about 15 / 18 hours a day you came to a point that the much you try to find something the less you see.

Thanks problem solved.