1
So guys I’m working on a support system where has a form for the user to send the message where he selects the area, type the title the message and also a to send files if necessary the problem is that PHP does not recognize the field <input type="file" name="anexo_msg" />
, when I give a <?php echo $_POST['anexo_msg'] ?>
in the field PHP returns the following error:
Follow the HTML code of the page:
<h3>Clientes</h3>
<?php echo "<p>".anchor("area_suporte", "<i class='icon-circle-arrow-left'></i> Voltar", array("class"=>"btn btn-small"))."</p>"; ?>
<?php echo form_open_multipart(current_url(), 'class="form-horizontal"'); ?>
<div class="control-group">
<label class="control-label">Área</label>
<div class="controls">
<select name="i_area" class="input-large">
<option value="" selected="selected" disabled="disabled">Selecione uma Área</option>
<?php
$query = $this->db->get('areas')->result_array();
foreach ($query as $data) :
?>
<option value="<?php echo $data['i_area']; ?>"><?php echo $data['nome']; ?></option>
<?php
endforeach;
?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label">Título</label>
<div class="controls">
<?php echo form_input('titulo', set_value('titulo'), 'class="input-xlarge" placeholder="Digite um Título"'); ?>
</div>
</div>
<div class="control-group">
<label class="control-label">Descrição</label>
<div class="controls">
<?php echo form_textarea('descricao', set_value('descricao'), 'class="input-xxlarge" rows="10" placeholder="Mensagem que será enviada e lida pelo técnico"'); ?>
</div>
</div>
<div class="control-group">
<label class="control-label">Arquivo</label>
<div class="controls">
<?php echo form_upload('anexo_msg'); ?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php
echo validation_errors('<p class="text-error">', '</p>');
if ($this->session->flashdata('msgok') != "")
{
echo '<p class="text-success">'.$this->session->flashdata('msgok').'</p>';
}
?>
<button type="submit" class="btn btn-primary">Enviar ao Suporte</button>
</div>
</div>
<?php echo $_POST['anexo_msg'] ?>
<?php echo form_close(); ?>
OBS: I’m using Codeigniter
Vlw guy helped a lot, more when I try to retrieve field content using codeigniter function
<?php echo $this->input->post('anexo_msg'); ?>
simply returns empty– Saymon
I don’t understand that, but check out this answer: http://stackoverflow.com/a/10818235/1817673
– Jorge B.