Insertion in Mysql with radio button + option + input

1

How do I insert the value of <input> into the database as the radio button is selected? A template is attached:

$funcionario=$this->funcionario->get_all_funcionario();if($funcionario->num_rows>0){$row=$funcionario->row();$atributosfuncionario=array('name'=>'xd','class'=>'funcionario','value'=>$row->pessoa_id);echoform_radio($atributosfuncionario);echoform_label('Funcionário');echoform_input(array('name'=>'pessoa','class'=>'selects','disabled'=>'disabled'),set_value('pesssoa',$row->nome));}$atributoscidadao=array('name'=>'xd','class'=>'cidadao');echoform_radio($atributoscidadao);echoform_label('Cidadão');echo'<selectname="pessoa" class="select">';
    $opcao = $this->funcionario->get_all_pessoa()->result();
    foreach($opcao as $linha){
    echo '<option value="'.$linha->id.'">'.$linha->nome.'</option>';
    }
    echo '</select>';

When I register, it is only getting the value of <option> Mário Silva, or any other value of <option> . Why can not I get the value in the input text? mark the radio button, and even then it continues! Does anyone know what it can be?

    
asked by anonymous 23.02.2015 / 21:36

1 answer

1

@ user11545 Regardless of the person dialing or you pick up from the database, the value of the input, select, checkbox that is marked will always be entered.

To get the value you send your form to a page like this.

$nome1 = $_POST["nomedoinput"];
$nome2 = $_POST["nomedoinput"];
$nome3 = $_POST["nomedoinput"];

and inserts in the bank like this

INSERT INTO tabela_nome VALUES ($nome1,$nome2,$nome3,...);
    
24.02.2015 / 01:36