Il sito dove ho inserito il form nuovo è il seguente, l ho fatto qui giusto per provare..
http://www.sardegnaadventures.com/html/contatti.html
L html è apposto..
Compilando i nuovicambi, l e-mail arriva alla posta regolarmente, ma le nuove voci sono inesistenti..
Ho fatto nuove prove, nel copiare le stringhe gia esistenti, ma non è cambiato nulla..
Codice PHP:
<?php
$receiverMail = "[email protected]";
$nome = trim(strip_tags(stripslashes($_POST['nick'])));
$mail = trim(strip_tags(stripslashes($_POST['mail'])));
$mail2 = trim(strip_tags(stripslashes($_POST['email2'])));
$subject = trim(strip_tags($_POST['oggetto']));
$msg = trim(strip_tags($_POST['messaggio']));
//$ip = getenv("REMOTE_ADDR");
$msgformat = "Nome: $nome\n";
$msgformat = "Città: $citta\n";
$msgformat.= "Email: $mail\n\n";
$msgformat.= "Messaggio:\n\t$msg";
// VALIDATION
if(empty($nome) || empty($mail) || empty($subject) || empty($msg))
{
header("Refresh: 2; URL=http://www.sardegnaadventures.com/html/contatti.html");
echo "<h3>Il modulo di richiesta non e' stato inoltratto</h3><p>Perfavore riempi tutti i campi obbligatori</p>";
echo "<p>Verrete reindirizzati alla pagina di compilazione campi entro 5 secondi</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $mail))
{
header("Refresh: 2; URL=http://www.sardegnaadventures.com/html/contatti.html");
echo "<h3>Il modulo di richiesta non e' stato inoltratto</h3><p>L'indirizzo mail e' invalido</p>";
echo "<p>Verrete reindirizzati alla pagina di compilazione campi entro 5 secondi</p>";
}
else
{
mail($receiverMail, $subject, $msgformat, "From: $nome <$email>");
header("Refresh: 2; URL=http://www.sardegnaadventures.com/html/contatti.html");
echo "<h3>Il modulo di richiesta e' stato inoltratto!</h3><p>Verrete ricontattati il prima possibile.</p>";
}
?>
Questa è la foto dell e-mail ricevuta..