salve a tuttisono nuovo nel forum e vorrei porvi una domanda:
come inviare gli allegati in mail con il php? ho scritto questo:
<form name="form1" method="post" action="mail.php">
<table width="95%" align="center" >
<tr>
<font size=7px><td colspan="2"><div align="center">
<font size=6px color=#CC00FF>MODULO CONTATTI</font> </div></td>
</tr>
<tr>
<td width="16%"><span style="background-color:#0099FF">Nome(*)</span></td>
<td width="84%"><input type="text" id="nome" name="nome"></td>
</tr>
<tr>
<td><span style="background-color:#0099FF">Cognome</span></td>
<td><input type="text" name="cognome"></td>
</tr>
<tr>
<td><span style="background-color:#0099FF">Città</span> </td>
<td><input type="text" name="citta"></td>
</tr>
<tr>
<td><span style="background-color:#0099FF">Indirizzo E-Mail(*)</span> </td>
<td><input type="text" id="mail" name="mail"></td>
</tr>
<tr>
<td><span style="background-color:#0099FF">Oggetto(*)</span></td>
<td><input type="text" id="oggetto" name="oggetto"></td>
</tr>
<tr>
<td><span style="background-color:#0099FF">Testo(*)</span></td>
<td><textarea name="testo" id="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>
<body background=http://us.123rf.com/400wm/400/400/linali/linali1101/linali110100008/8548863-email-di-segno-e-buste-su-uno-sfondo-di-puro.jpg>
<FONT SIZE=7PX>help</FONT>
<font size=4px><span style="background-color:#0099FF">(*campi obbligatori)</span></font>
</div>
</body>
e nel file mail.php
<?php
$to = "manu.fina@live.it";
$subject = "Modulo proveniente dal sito del giornalino scolastico Soft";
$body = "Contenuto del modulo:\n\n";
$body .= "Dati personali ; nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Citta: " . 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";
$headers = "From: Modulo utenti<INDIRIZZO-COME-SOPRA>";
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail è stata inoltrata con successo.
";
} else {
echo "Si sono verificati dei problemi nell'invio della mail, risolveremo il problema al più presto.";
}
?>
<body bgcolor=#FFFFFF>
inviane un'altra
torna alla home
</body>
cosa devo aggiungerci per poter inviare allegati?