想知道是否有人可以帮助我发现表单设置中的缺陷?电子邮件正在通过,但邮件发件人没有输入任何信息:
电子邮件正文:
姓名:
电子邮件:
现有客户:
组织类型:
信息:
这是HTML:
<form action="email.php" method="POST" name="contact" enctype="text/plain">
<label for="name">Name: </label><input type="text" name="name" id="name">
<label for="email">Email: </label><input type="text" name="email" id="email"><br><br>
<label for="existing">Have you written before?</label>
<input type="radio" name="existing" value="Yes" id="existingyes">Yes
<input type="radio" name="existing" value="No" id="existingno">No<br><br>
<label for="orgtype">How do you classify yourself? </label><select id="orgtype">
<option>Charity</option>
<option>Business</option>
<option>Individual</option>
<option>Meat Popcicle</option>
<option>Other</option>
</select><br><br>
<label for="essay">Thoughts? Questions? Comments</label><br>
<textarea name="essay" rows="3" cols="70" id="essay">...</textarea><br><br>
<input type="submit" value="Yell At Us!"><br>
这是PHP:
<?php
$name = stripslashes($_POST['name']);
$email = stripslashes($_POST['email']);
$existing = stripslashes($_POST['existing']);
$orgtype = stripslashes($_POST['orgtype']);
$essay = stripslashes($_POST['essay']);
$form_message = "Name: $name \nEmail: $email \nExisting Customer: $existing \nOrg Type: $orgtype \nMessage: $essay";
$success = mail("myemail@email.com", "Online Form Submission", $form_message, "From: $email" );
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=index.html\">";
} else {
echo "Sorry error please try again...";
}
?>
任何帮助将不胜感激!