I have a html form, which is sending the data through POST to the php-file, and the php-file should process the data (make a good looking structure) and send it via mail.
But the $_POST variable is completely empty....
I have this small html form:
<form id="form" method="post" action="formmailer.php">
<div id="input1">
<input name="name" type="text" placeholder="Ihr Name"> <br>
<input name="email" type="email" placeholder="Ihre E-Mail"> <br>
</div>
<div id="input2">
<textarea name="nachricht" rows="10" cols="30"></textarea> <br>
<input type="submit" value="" name="submit" id="submit">
</div>
</form>
And formmailer.php uses these variables:
<?php //
if(isset($_POST['nt']) && isset($_POST['ntb']))
{
//
$an = "[email protected]";
$name = $_POST['name'];
$email = $_POST['email'];
$nachricht = $_POST['nachricht'];
// Mailheader UTF-8
$mail_header = 'From:' . $email . "n";
$mail_header .= 'Content-type: text/plain; charset=UTF-8' . "rn";
// create layout
$message = "
Name: $name
Email: $email
Nachricht: $nachricht
";
// send mail
mail($an, $message, $mail_header );
}
else {
echo("<p>Email delivery failed…</p>");
}
?>
If i use this if-statement
if (isset($_POST["submit"]))
the mail is sending, but completely empty.
Am i blind? It should be really easy, shouldn't it?
if(isset($_POST['nt']) && isset($_POST['ntb']))