我遇到了類似的問題,但我一直無法解決我的聯繫表單問題。這是我通過我的電子郵件中的聯繫表單收到的。聯繫表格不返回任何內容?
<p>$usersname has contacted you from your site.</p>
<h3>Their Message is as follows:</h3>
<p>$usersmessage</p>
<h5>Contact details</h5>
<p>Phone Number: $usersphonenumber</p>
<p>Email Address: $usersemail</p>
<?php
if(isset($_REQUEST['contactformid']) && $_REQUEST['contactformid'] == 1){
$youremail = "[email protected]";
$usersname = $_POST["usersname"];
$usersemail = $_POST["usersemail"];
$usersphonenumber = $_POST["usersphonenumber"];
$usersmessage = $_POST["usersmessage"];
$subject = 'Message From Your Contact Form';
$message = '<p>$usersname has contacted you from your site.</p>
<h3>Their Message is as follows:</h3>
<p>$usersmessage</p>
<h5>Contact details</h5>
<p>Phone Number: $usersphonenumber</p>
<p>Email Address: $usersemail</p>';
$headers = 'From:' . $usersemail . "\r\n";
mail($youremail, $subject, $message, $headers);
echo '<p>Thank you for your email, a member of our staff will contact you soon regarding your email!</p>';
} else {
echo '<p>Form could not be sent, please try again!</p>';
}
?>
<div class="boxes-full">
<div class="contacttitle">
<h2>Contact Mogul</h2>
</div>
<div class="boxes-padding fullpadding">
<div id="contactwarning"></div>
<div id="contactajax"></div>
<form action="javascript:parseResponse();" method="post" name="ajaxcontactform" id="ajaxcontactform">
<div class="contacttextarea">
<input name="contactformid" id="contactformid" type="hidden" value="1" />
<fieldset>
<textarea name="comment" id="comment" cols="5" rows="5" class="contacttextarea"onfocus="if (this.value == 'Please Leave A Message') {this.value = '';}">Please Leave A Message</textarea>
</fieldset>
</div>
<div class="contacttextboxes">
<fieldset>
<input id="name" name="name" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Name') {this.value = '';}"value="Please Insert Your Name">
</fieldset>
<fieldset>
<input id="phone" name="phone" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Phone Number') {this.value = '';}"value="Please Insert Your Phone Number">
</fieldset>
<fieldset>
<input id="email" name="email" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Email') {this.value = '';}"value="Please Insert Your Email">
</fieldset>
<fieldset>
<input name="send" type="submit" class="contactformbutton" value="Send">
</fieldset>
</div>
</form>
</div>
<span class="box-arrow"></span>
</div>
爲什麼downvoted?謹慎解釋? – Nelson