if (isset($_POST["send"])) { $name = $_POST["name"]; $text = $_POST["text"]; $email = $_POST["email"]; if (strlen($name) == 0 || strlen($text) == 0) { $error = "Bitte Name und Nachricht eingeben"; } else { $text = $text . "\r\nAbsender: " . $name . " Absendermail: " . $email; mail("mail@christinaundroman.info", "Mail über Kontaktformular", $text); $mysqli = new mysqli("localhost", "greilat_hochzeit", "@CmnT&hhDlG;", "greilat_hochzeit"); if (!$mysqli) { die('keine Verbindung möglich: ' . mysql_error()); } !$mysqli->set_charset("utf8mb4"); $query = "INSERT INTO hz_contact (date, name, email, text) VALUES (curdate(), '$name', '$email', '$text')"; $mysqli->query($query); $sent = true; } } ?>
|
if (isset($error)) { ?>
} ?> if (isset($sent) && ($sent == true)) { ?> Deine Nachricht wurde gesendet } else { ?> } ?> |