Salve spero possiate aiutarmi, ho bisogno che dopo l'invio di dati tramite form la stessa pagina mi si riaggiorni per farmi vedere i dati appena inviati. Il form che utilizzo è il seguente :
codice:<? /////////////////////////////////////////////////////CARICA IMMMAGINE///////////////////////////////////////////////////////// if($_POST['submit']=="upload"){ if ($product[foto] =='') { }else{echo "Sul database è gia presente una foto Vuoi continuare e cancellare la foto esistente ?? <a href=\"javascript:info('cancellafotonews.php?&id=$product[idnews]&file=$product[foto]')\">si</a> <form name=\"form3\" method=\"post\" action=\"\"><input name=\"No\" type=\"submit\" value=\"no\"></form>\n"; exit; } $path = "../moduli/news/img/"; if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) { if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists \n"; exit; } $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path . $HTTP_POST_FILES['userfile']['name']); if (!$res) { echo "caricamento immagine fallito! \n"; exit; } else { echo "caricamento immagine avvenuto \n"; } } else { echo "Wrong file type \n"; } $image = $HTTP_POST_FILES['userfile']['name']; $UPDATE = mysql_query("UPDATE news SET foto='$image' WHERE idnews='". $_POST['id'] ."'",$db); } ?> <table width="91%" border="0" cellspacing="1" cellpadding="2" height=""> Se vuoi aggiungere un'immagine alla news ho cambiare quella esistente usa il form quì sotto : <form enctype="multipart/form-data" method="post" action=""> <tr><td align="right" bgcolor="#EBEBEB">Id news:</td><td bgcolor="#F7F7F7"><input name="id" type="text" class="boxes" value="<?=$product[idnews];?>" readonly="readonly" size="10"></td></tr> <tr><td align="right" bgcolor="#EBEBEB">Foto ora sul database:</td><td bgcolor="#F7F7F7"><input name="fotoora" type="text" class="boxes" value="<?=$product[foto];?>" readonly="readonly" size="50"></td></tr> <tr><td align="right" bgcolor="#EBEBEB">File :</td><td bgcolor="#F7F7F7"><input name="userfile" type="file"></td></tr> <tr><td align="right" bgcolor="#EBEBEB"></td><td bgcolor="#F7F7F7" width="70%"><input type="submit" name="submit" value="upload"></td></tr> </form></table>

Rispondi quotando