Hi Rodney,
I tried to modify the Script as written by you:
<?php
if (!isset($_POST['send'])) {
echo 'Ein Fehler ist aufgetreten. Bitte gehen Sie auf diese
<a href="englische_seiten/contact.php">Seite</a>.';
exit;
} else {
// Variablen:
$meinmail = [email]a@a.it[/email]';
$danke = 'englische_seiten/thanks.php';
$fehler = 'englische_seiten/error.php';
foreach($_POST as $var => $val) {
if (!empty($val)) {
$$var = trim($val);
} else {
$$var = 'nichts';
}
}
// wenn leer:
if ($cognome == 'nichts' || $nome == 'nichts' || $email == 'nichts' || $messaggio == 'nichts') {
print '<meta http-equiv="refresh" content="0; url=' . $fehler . '">';
exit;
} else {
// Deutsch:
$mailnachricht = 'Sie haben folgende Nachricht erhalten: ' . "\n\n" .
$messaggio . "\n\n" .
'Gesendet von: ' . "\n\n" .
'Cognome: ' . $cognome . "\n" .
'Nome: ' . $nome . "\n" .
'Azienda: ' . $azienda . "\n" .
'Via: ' . $via . "\n" .
'Citta: ' . $citta . "\n" .
'Nazione: ' . $nazione . "\n" .
'Telefone: ' . $telefono . "\n" .
'EMail: ' . $email . "\n\n" .
'Datum/Zeit: ' . date("d.m.Y H:i:s");
$mailbetreff = 'Kontakformular';
$von = 'From: ' .$email . "\r\n";
// English:
$mailnachricht2 = $nome . ' ' . $cognome .
', you have sent the following message to us: ' . "\n\n" .
$messaggio . "\n\n\n" .
'We will contact you as soon as possible.' . "\n\n\n" .
'Kind regards.' . "\n\n\n" .
'Your Team';
$mailbetreff2 = "Confirmation mail";
$von2 = 'From: ' . $meinmail . "\r\n";
// senden mail
if (mail($meinmail, $mailbetreff, $mailnachricht, $von)) {
sleep(1);
// möglicherweise wichtig
// senden mail
if (mail($email, $mailbetreff2, $mailnachricht2, $von2)) {
// senden sie zu danke seite
print '<meta http-equiv="refresh" content="0; url=' . $danke . '">';
exit;
} else {
echo 'Entschuldigen. Ein Fehler ist aufgetreten. Zuruck, bitte.';
}
} else {
echo 'Entschuldigen. Ein Fehler ist aufgetreten. Zuruck, bitte.';
}
?>
But then I get the following error:
Parse error: parse error, unexpected $ in /contattia.php on line 91
It´s strange because in that line I have only HTML.