tuningtpt Posted September 3, 2014 at 01:42 PM Report Share #566139 Posted September 3, 2014 at 01:42 PM Tenho um form que nao envia as coisas pelo POST <form name="upload_imagem" method="post" enctype="multipart/form-data" action="inserir_produto_upload.php"> <center> Nome Produto:<br> <input type="text" name="nomeProduto"><br> Preço S/ Iva:<br> <input type="text" name="precoSiva"><br> Pequena Descrição:<br> <textarea type="text" name="pequenaDescricao"></textarea><br> Descrição:<br> <textarea type="text" name="Descricao"></textarea><br> Imagem 1:<br> <input type="file" name="imagem"><br> Imagem 2:<br> <input type="file" name="imagem2"><br> <input name="Submit" type="submit" value="Upload" class="botao"> </center> </form> Link to comment Share on other sites More sharing options...
I-NOZex Posted September 3, 2014 at 04:16 PM Report Share #566178 Posted September 3, 2014 at 04:16 PM no ficheiro PHP, na primeira linha, faz um die(var_dump($_POST)); e vê o que aparece B2R » Beat2Revolution v3.0b | Regista e divulga-nos beat2revolution.net Link to comment Share on other sites More sharing options...
tuningtpt Posted September 3, 2014 at 05:03 PM Author Report Share #566183 Posted September 3, 2014 at 05:03 PM array (size=0) empty Link to comment Share on other sites More sharing options...
I-NOZex Posted September 3, 2014 at 05:42 PM Report Share #566187 Posted September 3, 2014 at 05:42 PM espera nem tinha visto bem, tu queres enviar ficheiros certo? se sim, tens que aceder por: $_FILES B2R » Beat2Revolution v3.0b | Regista e divulga-nos beat2revolution.net Link to comment Share on other sites More sharing options...
tuningtpt Posted September 4, 2014 at 08:33 AM Author Report Share #566210 Posted September 4, 2014 at 08:33 AM (edited) eu no inserir_produto_upload.php tenho isto $nomeProduto=$_POST['nomeProduto']; $precoSiva=$_POST['precoSiva']; $pequenaDescricao=$_POST['pequenaDescricao']; $Descricao=$_POST['Descricao']; $uploads_dir = '../image/produtos'; $uploads_dir2 = 'image/produtos'; if ($_FILES["image"]['error']==UPLOAD_ERR_OK AND $_FILES["image2"]['error']==UPLOAD_ERR_OK) { $query="Select * from produtos"; $faz_procura= mysqli_query($ligabd,$query); $num_registos=mysqli_num_rows($faz_procura); $name = $_FILES["image"]["name"]; $name2 = $_FILES["image2"]["name"]; $extension = getExtension($name); $extension2 = getExtension($name2); $nome=$num_registos+1; $nome2=$nome.'.'.$extension; $nome3=$num_registos.'_pequena'; $nome4=$nome3.'.'.$extension; $tmp_name = $_FILES["image"]["tmp_name"]; $tmp_name2 = $_FILES["image2"]["tmp_name"]; $imagem2= "$uploads_dir/$nome2"; $nome_bd="$uploads_dir2/$nome2"; $imagem3= "$uploads_dir/$nome4"; $nome_bd2="$uploads_dir2/$nome4"; if(move_uploaded_file($_FILES["image"]["tmp_name"],$imagem2) AND move_uploaded_file($_FILES["image2"]["tmp_name"],$imagem3)) {echo '<br>sucesso';} else {echo '<br>falha';} $query5="UPDATE produtos SET Nome_produto='".$nomeProduto."', caminho_imagem='".$nome_bd."', caminho_imagem2='".$nome_bd2."', Preco_s_iva='".$precoSiva."', Descricao='".$Descricao."', Pequena_descricao='".$pequenaDescricao."' WHERE id_produto='".$id."'"; $faz_procura5=mysqli_query($ligabd,$query5); será pelo tamanho das imagens? Edited September 4, 2014 at 09:06 AM by tuningtpt Link to comment Share on other sites More sharing options...
I-NOZex Posted September 4, 2014 at 10:04 AM Report Share #566219 Posted September 4, 2014 at 10:04 AM no form, tens 2 campos: imagem e imagem2 mas no php chamas por $_FILES["image"] e $_FILES["image2"] 👍 1 Report B2R » Beat2Revolution v3.0b | Regista e divulga-nos beat2revolution.net Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now