1
Gentlemen, I’m new here, and I’m unanswered as to what’s going on. I created a $rga variable to insert through a field, but it doesn’t work.
This srcipt uploads a photo and resizes. From the displayed mode it does not accept the $rga variable
If I put the lines
$rga = $_POST['rga'];
mysql_query(" UPDATE penpals SET picture = ' uploads/$filename ' WHERE ID = '$rga' ");
below the }
Then the problem becomes uploads/$filename
who doesn’t carry the photo.
And the variable $rga
starts to work.
Could someone 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>
Thanks friends for the tip.. already rosolvido.
– Marcio