1
I cannot return my page because it does not traffic data on URL.
I have this following Form:
<form name="formulario_arquivo" id="formulario" method="POST" action="upload_foto/proc_upload.php" enctype="multipart/form-data">
<table class="formulario">
<tbody>
<tr class="cabecalho">
<td>
<label for="arquivo">Arquivo </label>
</td>
<td>
<input name="arquivo" id="nome_arquivo" type="file" class="elemento_a_esquerda">
</td>
</tr>
</tbody>
<tr class="rodape">
<td></td>
<td>
<button type="submit" value="Cadastrar" class="elemento_a_direita">
<img src="mgm/importar.png" alt="Importar">
</button>
</td>
</tr>
</table>
</form>
That is sending data to save the imported file to another page, but need to return from page proc_upload.php
to my current page.
if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $_UP['pasta']. $nome_final)){
//Upload efetuado com sucesso, exibe a mensagem
$query = mysqli_query($conn, "INSERT INTO arquivos (
codigo,arquivo,data_) VALUES(NULL,'$nome_final',NOW())");
echo "
<META HTTP-EQUIV=REFRESH CONTENT = '0;URL=http://localhost/site_opus/public_html/sistema/_sistema.php'>
<script type=\"text/javascript\">
alert(\"Imagem cadastrada com Sucesso.\");
</script>
";
}
This is the page that returns the data, however mine URL is fixed.
In this case you would have to use javascript, to upload the image without Reload or change the url of your page.
– Jonathan Willian
Cara vc could give me an idea of how I’ve never done information traffic with javascript just by php.
– Wesley Float
I’m using this function here: Function loads_data(id_called){ //-------> Was working $.ajax({ type: 'POST', url: 'scriptPHP3.php', date: 'id=' + id_called, Success: Function(data){ $('#test').html(data); } }); } but I don’t know how to adapt it to my site
– Wesley Float