0
I created a function
to register images that until yesterday at 18:00 functioned normally and this morning the data of form
are not being passed.
I can’t believe nobody messed with the code.
<?php //Chama a função inserir caso tenha algum dado em POST (includes/conexao)
if (isset($_POST['salvar'])) {
criar_album('albumImagens', 'capa', $_POST);
}
?>
<form class="form-horizontal" method="POST" action="" enctype="multipart/form-data" />
<fieldset>
<legend>Nova imagem</legend>
<div class="form-group">
<label class="col-md-3 control-label" for="nome">Nome</label>
<div class="col-md-6">
<input id="nome" name="nome" type="text" placeholder="" class="form-control input-md" required>
</div>
</div>
<!-- Text input -->
<div class="form-group">
<div id="thumbnail">
</div>
<label class="col-md-3 control-label" for="capa">Capa:</label>
<div class="col-md-4">
<input type="file" name="capa" class="form-control" required>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-3 control-label" for="imagem">Album:</label>
<div class="col-md-4">
<input type="file" name="imagem[]" class="form-control" required multiple>
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-3 control-label" for="salvar"></label>
<div class="col-md-5">
<button name="salvar" class="btn btn-primary btn-lg">Salvar</button>
</div>
</div>
</fieldset>
</form>
To check if the data was being passed I did;
function criar_album($album, $destaque, $dados){
$con = conectar();
var_dump($dados);
die();
}
And the only data passed is the first input nome
.
Does anyone know what might be going on?
Already checked your application/server error logs?
– Bruno Wego
Debug $_POST. See what data comes in the method post. In your form, you are using class. Why not use name? I think this issue of id and class are often used without necessity. If you use name, you have more success restoring it to what is passed in the $_POST. This is what I think and, for the sake of logic, you should pass, in addition to the label, the name of that field in the form. This avoids error when saving in the bank. I don’t know if I’m right or if I’m exchanging some concept.
– André Nascimento
@Andrénascimento a class e id do not interfere in anything, and as I put in the post I did the
var_dump
to know what was being passed via post and only the inputnome
this being past.– RFL
@Rafael Acioly .
– André Nascimento