php - No values in $_POST variable after Submit HTML form -
i have html form, sending data through post php-file, , php-file should process data (make looking structure) , send via mail.
but $_post variable empty....
i have 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 = "info@website.de"; $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 use if-statement
if (isset($_post["submit"]))
the mail sending, empty.
am blind? should easy, shouldn't it?
isset($_post['nt']) && isset($_post['ntb'])
in html not find nt
, ntb
field.
when use isset($_post["submit"])
. in post
array php find submit
value. did not enter value in form fields why getting empty value in mail.
Comments
Post a Comment