Upload immagini Dreamweaver
--------------------------------------------------------------------------------
Ciao a tutti...sono nuovo qui e girando un po' su internet vi ho trovato..
Volevo farvi una domanda...
Praticamente sto creando un sito e prendendo spunti un po' in giro ho creato un modulo per inserire i propri dati e questi dati vengono inviati sulla mia e-mail.
la domanda che volevo farvi č che se mi potevate aiutare ad inserire in quel modulo un upload in modo che gli utenti possono caricare piu' di un immagine e inviarmela sempre per e-mail insieme agli altri dati..
Premetto che non sono un esperto ed č la prima volta che faccio queste cose.
Posto il codice in modo che capite meglio cosa sto facendo.
Codice html del form
Codice HTML:
Codice HTML:<form name="form1" method="post" action="mail.php"> <table width="95%" align="center" > <tr> <td colspan="2"><div align="center"><strong>MODULO CONTATTI </strong></div></td> </tr> <tr> <td width="16%"><strong>Nome</strong></td> <td width="84%"><input type="text" name="nome"></td> </tr> <tr> <td><strong>Cognome</strong></td> <td><input type="text" name="cognome"></td> </tr> <tr> <td><strong>Città </strong></td> <td><input type="text" name="citta"></td> </tr> <tr> <td><strong>Indirizzo E-mail </strong></td> <td><input type="text" name="mail"></td> </tr> <tr> <td><strong>Oggetto</strong></td> <td><input type="text" name="oggetto"></td> </tr> <tr> <td><strong>Testo</strong></td> <td><textarea name="testo" cols="40" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="Submit" value="Invia"> </div></td> </tr> </table> </form>
Codice php dell'invio sull'e-mail
Codice PHP:
Codice PHP:<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "la mia e-mail";
// IL SOGGETTO DELLA MAIL
$subject = "Modulo proveniente dal sito ";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body .= "nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Cittā: " . trim(stripslashes($_POST["citta"])) . "\n";
$body .= "Oggetto: " . trim(stripslashes($_POST["oggetto"])) . "\n";
$body .= "testo: " . trim(stripslashes($_POST["testo"])) . "\n";
$body .= "mail: " . trim(stripslashes($_POST["mail"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: Modulo utenti<la mia e-mail>";
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail č stata inoltrata con successo.";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>
Ringrazio tutti quelli che mi rispondono e resto in attesa di aiuto

LinkBack URL
About LinkBacks
