这里真的很奇怪......希望别人看看......谢谢。
这是我使用的HTML:
<div id="contactform">
<form name="sentMessage" id="contactForm" novalidate action="" class="popup-form">
<input type="text" class="form-control form-white" id="name" name="name" placeholder="Full Name">
<input type="text" class="form-control form-white" id="phone" name="phone" placeholder="Email Address">
<input type="text" class="form-control form-white" id="email" name="email" placeholder="Phone Number">
<input type="text" class="form-control form-white" id="reach" name="reach" placeholder="Best Form of Contact">
<input type="text" class="form-control form-white" id="attendees" name="attendees" placeholder="Number of Guests">
<input type="text" id="overnight" name="overnight" class="form-control form-white" placeholder="Number of Overnight Guests">
<input type="text" class="form-control form-white" id="event" name="event" placeholder="Type of Event">
<input type="text" class="form-control form-white" id="meals" name="meals" placeholder="Meals included?">
<input type="text" class="form-control form-white" id="date" name="date" placeholder="Date Desired (ex. 4/16-4/25)">
<input type="text" rows="10" cols="100" class="form-control form-white" id="message" name="message" placeholder="More Info">
<button type="submit" class="btn btn-submit">Submit</button>
<div id="success"></div>
</form>
</div>
这就是JS。
<?php
// check if fields passed are empty
if(empty($_POST['name']) ||
empty($_POST['phone']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$message = "Name: " . $_POST['name'];
$message .= "\r\nPhone " . $_POST['phone'];
$message .= "\r\nEmail: " . $_POST['email'];
$message .= "\r\nRequested Form of Contact: " . $_POST['reach'];
$message .= "\r\nEvent Type: " . $_POST['event'];
$message .= "\r\nRequested Dates: " . $_POST['date'];
$message .= "\r\nNumber of Attendees: " . $_POST['attendees'];
$message .= "\r\nOvernight Guests: " . $_POST['overnight'];
$message .= "\r\nMeals Included?: " . $_POST['meals'];
$message .= "\r\nAdditional Information: " . $_POST['message'];
$to = 'fakeemailforprivacy@gmail.com';
$email_subject = "Wahnee Events Inquiry";
$email_body = $message;
$headers = "From: inquiry@wahneeevents.com\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>
是的,它是通过我的HTML(JS文件)链接的 不太确定问题是什么,因为它与旧的联系表单一起使用,我只是复制并粘贴它......嗯。
答案 0 :(得分:0)
尝试更改
<button type="submit" class="btn btn-submit">Submit</button>
到
<button action="submit" class="btn btn-submit">Submit</button>