I've got a strange problem: the same script is working in a different site I've built but not on my current one. The php script refers to a html page (a submitting form) and I just want to send it to an email. Here's the HTML code:
<form class="form-horizontal" action="invio_mail.php">
<div class="form-group">
<label for="indirizzo">Indirizzo attivazione</label>
<input id="indirizzo" name="indirizzo" type="text" class="form-control" placeholder="Via Roma, 15" required autofocus>
</div>
<div class="form-group">
<label for="modem">Tipo di modem</label>
<select id="modem" name="modem" class="form-control">
<option>Indoor</option>
<option>Outdoor</option>
</select>
</div>
....
<input name="submit" class="btn btn-lg btn-primary btn-block" type="submit" value="Invia">
And here's the script:
<?php
$mailto = 'myemail@gmail.com';
$subject = 'Form';
$error_message = 'Wooops! Something goes wrong.';
$success_message = '<strong><em>SENT!</em></strong>';
$indirizzo = $_POST['indirizzo'];
$modem = $_POST['modem'];
$consegna = $_POST['consegna'];
$nome = $_POST['nome'];
$cognome = $_POST['cognome'];
$dob = $_POST['dob'];
$paese = $_POST['paese'];
$citta = $_POST['citta'];
$codice_fiscale = $_POST['codice_fiscale'];
$cellulare = $_POST['cellulare'];
$documento = $_POST['documento'];
$scadenza_doc = $_POST['scadenza_doc'];
$rilascio_doc = $_POST['rilascio_doc'];
$email = $_POST['email'];
$note = $_POST['note'];
$message = "The following variables has been registered: $indirizzo $modem $consegna $nome $cognome $dob $paese $citta $codice_fiscale $cellulare $documento $scadenza_doc $rilascio_doc $email $note";
$headers = "Da: " . "X-Mailer: PHP/" . phpversion();
if (mail($mailto, $subject, $message, $headers)) {
echo("<br>$success_message <br><br><br>");
;
} else {
echo($error_message);
}
?>
I receive the mail but it won't me display my variables! I don't know why and i'm getting crazy. The message is only "The following variables has been registered" followed by nothing at all..am I missing something in the syntax? In my old site is working fine.
Thank you all for your patience.