Srs, I'm new here, I have no answer to know what is happening. I created a $ rga variable to insert through a field, but it does not work.
This srcipt uploads a photo and resizes it. In the displayed mode it does not accept the variable $ rga
If I put the lines
$rga = $_POST['rga'];
mysql_query(" UPDATE penpals SET picture = ' uploads/$filename ' WHERE ID = '$rga' ");
below }
Then the problem happens to be uploads/$filename
that does not load the photo.
And the $rga
variable starts to work.
Can anyone help me?
<?
if ( isset( $_POST['submit'] ) ){
$pasta = 'uploads';
$file = $_FILES['arquivo'];
$temp = $file['tmp_name'];
$filename = $file['name'];
$largura_max = 130;
$altura_max = 130;
require ('redimensiona_fotos.php');
$result = upload($temp, $filename, $largura_max, $altura_max, $pasta);
echo "<img src=\"uploads/$filename\">";
$rga = $_POST['rga'];
mysql_query(" UPDATE penpals SET picture = ' uploads/$filename ' WHERE ID = '$rga' ");
}
?>
<form action="" method="post" enctype="multipart/form-data">
<label for="arquivo">Arquivo:</label>
<input type="file" name="arquivo" id="arquivo" />
<br />
<input type="submit" name="submit" value="Abrir imagem" />
</form>
<form action="" method="post" enctype="multipart/form-data">
<span class="add-on">User</span>
<input id="rga" name="rga" type="text" maxlength="40" placeholder="Informe ID" />
<input class="form_botao" type="submit" name="Enviar" value="Precione para Enviar a FOTO - SALVE ABAIXO "><br>
</form>