eeewwwww!!!!
windows su hosting aruba???
brutta storia...
ma sei sicura che ci sia il modulo php installato sulle piattaforme windows?
permettimi di consigliarti un cambio del tuo piano da windows a linux, tempo fa era possibile passare da win a linux pagando mi pare 15€.
il form lo dovrai modificare qua e la in base alle tue necessità, comunque grosso modo:
index.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sistema di invio email</title>
<link rel="stylesheet" type="text/css" media="screen" href="stile/style.css">
</head>
<body>
<?php
if(isset($_GET['err'])) {
echo'<div id="err">';
switch ($_GET['err']) {
case 'i':
echo "Completa tutti i campi obbligatori.";
break;
case 'e':
echo "Indirizzo email non valido.";
break;
case 'ok':
echo "Email inviata correttamente.";
break;
case 'x':
echo "Errore durante l'invio dell'email.";
break;
}
echo'</div>';
}
?>
<form name="sendmail" action="send.php" method="POST">
<div id="table-wrap">
<table id="contatti_wrap">
<tr><td>
<div id="dati-wrap">
<table class="contact-table">
<tr>
<th colspan="2">Dati Personali</th>
</tr>
<tr>
<td>* Nome</td>
<td><input name="nome" type="text" size="15"></td>
</tr>
<tr>
<td>* Cognome</td>
<td><input name="cognome" type="text" size="15"></td>
</tr>
<tr>
<td>* Società</td>
<td><input name="email" type="text" size="15"></td>
</tr>
<tr>
<td>* E-mail</td>
<td><input name="società" type="text" size="15"></td>
</tr>
<tr>
<td>Telefono</td>
<td><input name="indirizzo" type="text" size="15"></td>
</tr>
<tr>
<td>Indirizzo</td>
<td><input name="indirizzo" type="text" size="15"></td>
</tr>
<tr>
<td>Comune</td>
<td><input name="comune" type="text" size="15"></td>
</tr>
<tr>
<td>Provincia</td>
<td><input name="provincia" type="text" size="15"></td>
</tr>
<tr>
<td>Nazione</td>
<td><input name="nazione" type="text" size="15"></td>
</tr>
<tr>
<td colspan="2">* I campi con l'asterisco sono obbligatori</td>
</tr>
</table>
</div>
</td><td>
<div id="info-wrap">
<table class="contact-table">
<tr>
<td>Quali informazioni vorresti ricevere?</td>
</tr>
<tr>
<td><textarea name="note" cols="26" rows="5"></textarea></td>
</tr>
</table>
</div>
<div id="button"><br/><input type="submit" value="Invia"></div>
</td></tr>
<tr>
<td>
<div id="prodotti-wrap">
<table valign="top" class="contact-table">
<tr>
<th colspan="2">Indica i prodotti che ti interessano:</th>
</tr>
<tr>
<td><input type="checkbox" name="ch1" value="si"></td>
<td>Prodotto1</td>
</tr>
<tr>
<td><input type="checkbox" name="ch2" value="si"></td>
<td>Prodotto2</td>
</tr>
<tr>
<td><input type="checkbox" name="ch3" value="si"></td>
<td>Prodotto3<td>
</tr>
</table>
</div>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
send.php
<?php
function parse_eMailAddress($eMailAddress){ //controllo indirizzo valido
if(ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$", $eMailAddress))
return true;
else
return false;
}
if (empty($_POST["nome"])||empty($_POST["cognome"])||empty($_POST["societa"])||empty($_POST["email"])){ //controllo i campi obbligatori
header("Location: ./index.php?err=i");
}
else{ //i campi obbligatori sono stati compilati
$from = $_POST["email"]; //mittente
$subject = "Richiesta informazioni"; //oggetto
$prodotti="";
if($_POST["ch1"]=='si'){$prodotti.="Prodotto1 <BR/>";}
if($_POST["ch2"]=='si'){$prodotti.="Prodotto2 <BR/>";}
if($_POST["ch3"]=='si'){$prodotti.="Prodotto3 ";}
$message = '
<html>
<head>
</head>
<body>
<div id="contatto">
<FIELDSET>
<LEGEND>Dati Contatto</LEGEND>
<p>Richiesta inviata da '.$_POST["nome"].' '.$_POST["cognome"].'<BR/>
'.$_POST["societa"].'<BR/>
'.$_POST["indirizzo"].', '.$_POST["comune"].' - '$_POST["provincia"]' - '.$_POST["nazione"].'<BR/>
'.$_POST["email"].'</p>
</FIELDSET>
</div>
<div id="interessi">
<div id="prodotti">
<FIELDSET>
<LEGEND>Prodotti di interesse</LEGEND>
<p>'.$prodotti.'</p>
</FIELDSET>
</div>
</div>
<div id="domanda">
<FIELDSET>
<LEGEND>Domanda</LEGEND>
<p>'.$_POST["note"].'</p>
</FIELDSET>
</div>
</body>
</html>
';
// mime per invio mail
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// header aggiuntivi
$headers .= 'To:
[email protected]' . "\r\n"; //inserire l'indirizzo di destinazione
$headers .= 'From: '.$_POST["email"] . "\r\n";
if (!parse_eMailAddress($from)){ //indirizzo email NON valido
header("Location: ./index.php?err=e");
}
else{ //indirizzo email valido
if (mail($to, $subject, $message, $headers)) {
header("Location: ./index.php?err=ok");
}
else {
header("Location: ./index.php?err=x");
}
}
}
?>
ci saranno da implementare anche dei controlli più avanzati sui dati inseriti ma direi che per quanto riguarda la struttura ci siamo.
ti ripero quello che ti ho gia detto io ed anche gli altri, studiati il php e l'html perchè altrimenti non sarai in grado di fare nemmeno le cose più basilari