我不能让它正常工作。我知道它有些愚蠢,但我找不到它。
<?php
$mailto = "stormygurl73@yahoo.com";
$name = ucwords($_POST['name']);
$subject = $_POST['Contact form'];
$email = $_POST['email'];
$message = $_POST['message'];
if(strlen($_POST['name']) < 1 ){
echo 'email_error';
}
else if(strlen($email) < 1 ) {
echo 'email_error';
}
else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $email)) {
echo 'email_error';
}
else if(strlen($message) < 1 ){
echo 'email_error';
} else {
// NOW SEND THE ENQUIRY
$email_message="\n\n" .
"Name : " .
ucwords($name) .
"\n" .
"Email : " .
$email .
"\n\n" .
"Message : " .
"\n" .
$message .
"\n" .
"\n\n" ;
$email_message = trim(stripslashes($email_message));
mail($mailto, $subject, $email_message, "From: \"$vname\" <".$email.">\nReply-To: \"".ucwords($name)."\" <".$email.">\nX-Mailer: PHP/" . phpversion() );
}
?>
html
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">
<form id="contact-form" action="sendemail.php" method="post">
<h3>Get in touch</h3>
<h4>Fill in the form below, and we'll get back to you within 24 hours.</h4>
<div>
<label>
<span>Name: (required)</span>
<input placeholder="Please enter your name" type="text" tabindex="1" required autofocus>
</label>
</div>
<div>
<label>
<span>Email: (required)</span>
<input placeholder="Please enter your email address" type="email" tabindex="2" required>
</label>
</div>
<div>
<label>
<span>Message: (required)</span>
<textarea placeholder="Include all the details you can" tabindex="5" required></textarea>
</label>
</div>
<div>
<button name="submit" type="submit" id="contact-submit">Send Email</button>
</div>
</form>
<!-- /Form -->
任何帮助都是极好的!