The html is not sending the images to the server

0

I have the following modal:

    <!-- MODAL PARA CADASTRO DE TAMANHOS -->
    <div class='modal fade' id='modalTamanho' tabindex='-1' role='dialog' aria-labelledby='myModal'>
    <div class='modal-dialog' role='document'>
    <div class='modal-content'>
    <div class='modal-header'>
    <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
    <h4 class='modal-title' id='myModalLabel'>Cadastro de tamanhos</h4>
  </div>
  <div class='modal-body'>
      <form id='tamanho' name='tamanho' method='post' enctype='multipart/form-data'>
        <label>Componente : </label>
        <select class='form-control componente' id= 'selectComponentes' name='selectComponentes'>
              <?php
                $query = ("select id_principal from componentes,aparelhos where componentes.id_secundario = ".$_POST['selectTamanho']." and aparelhos.id = ".$_POST['selectTamanho']." ");
                $max = mysqli_query($con,$query);
                while ($i = mysqli_fetch_row($max))
                {
                  $query = ("select id_principal,nome from componentes where id_principal = ".$i[0]." ");
                  $aparelho = mysqli_query($con,$query);
                  $fetch = mysqli_fetch_row($aparelho);
                  $id = $fetch[0];
                  $nome = $fetch[1];
                  print "<option value='".$id."'>".$nome."</option>";
                }
              ?>
      </select>
      <div class='form-group'>
      <label>Entrada : </label>
      <input type='text' class='form-control' id='labelEntrada' name='labelEntrada'>
      </div>
      <div class='form-group'>
      <label>Saída : </label>
      <input type='text' class='form-control' id='labelSaida' name='labelSaida'>
      </div>
      <div class='form-group'>
      <label>Quantidade F: </label>
      <input type='text' class='form-control' id='labelQuantidadef' name='labelQuantidadef'>
      </div>
      <div class='form-group'>
      <label>Quantidade M: </label>
      <input type='text' class='form-control' id='labelQuantidadem' name='labelQuantidadem'>
      </div>
      <div class='form-group'>
      <label>Quantidade G: </label>
      <input type='text' class='form-control' id='labelQuantidadeg' name='labelQuantidadeg'>
      </div>
    <div class='form-group'>
      <label>Quantidade GG: </label>
      <input type='text' class='form-control' id='labelQuantidadegg' name='labelQuantidadegg'>
    </div>
    <div class='form-group'>
      <label>Foto do componente : </label>
      <input id='fotoComponente' name='fotoComponente' type='file'>
    </div>
    <div class='form-group'>
      <label>Foto do acabamento : </label>
      <input id='fotoAcabamento' name='fotoAcabamento' type='file'>
    </div>
    <div class='form-group'>
      <label>Foto da máquina : </label>
      <input id='fotoMaquina1' name='fotoMaquina1' type='file'>
    </div>
    <div class='form-group'>
      <label>Foto da máquina : </label>
      <input id='fotoMaquina2' name='fotoMaquina2' type='file'>
    </div>
    <button type='submit' class='btn btn-success'>Gravar</button>
    </form>
  </div>
  <div class='modal-footer'>
  <button type='button' class='btn btn-danger' data-dismiss='modal'>Sair</button>
  </div>
</div>  
</div>
</div>
  

But when I try to use the post to check if the variable was filled with php, php replies that the variable is empty.

    
asked by anonymous 15.02.2017 / 18:30

1 answer

1

Friend, $ _POST is only for text, radio, select, etc. fields. To receive the uploaded file use the $ _FILES variable.

link

    
15.02.2017 / 18:34