我在使用此联系表时遇到问题,我无法使其正常工作,请帮忙?我已经在本地主机和虚拟主机上尝试过,但似乎没有任何效果。
发送.php
<?php
header('content-type: application/json; charset=utf-8');
if (isset($_GET["mrova-name"])) {
$name = strip_tags($_GET['mrova-name']);
$email = strip_tags($_GET['mrova-email']);
$message = strip_tags($_GET['mrova-message']);
$header = "From: ". $name . " <" . $email . ">rn";
$ip = $_SERVER['REMOTE_ADDR'];
$httpref = $_SERVER['HTTP_REFERER'];
$httpagent = $_SERVER['HTTP_USER_AGENT'];
$today = date("F j, Y, g:i a");
$recipient = 'myemail@gmail.com';
$subject = 'Advertising';
$mailbody = "
First Name: $name
Email: $email
Message: $message
IP: $ip
Browser info: $httpagent
Referral: $httpref
Sent: $today
";
$result = 'success';
if (mail($recipient, $subject, $mailbody, $header)) {
echo json_encode($result);
}
}
?>
我使用了“发布”方法,但它从来没有用过
联系表格.html
<div id="mrova-feedback">
<div id="mrova-contact-thankyou" style="display: none;">
Thank you. We'hv received your feedback.
</div>
<div id="mrova-form">
<form id="mrova-contactform" action="css/send.php" method="post">
<ul >
<li>
<center><h2 class="mrova-contactform-head">Quick Contact</h2></center>
<label for="mrova-name">Your Name<font color="red">*</font></label> <input type="text" name="mrova-name" class="required" id="mrova-name" value="">
</li>
<li>
<label for="mrova-email">Email<font color="red">*</font></label> <input type="text" name="mrova-email" class="required" id="mrova-email" value="">
</li>
<li>
<label for="mrova-message">Message<font color="red">*</font></label>
<textarea class="required" id="mrova-message" name="mrova-message" rows="8" cols="30"></textarea>
</li>
</ul>
<input type="submit" style="button" value="Send" id="mrova-sendbutton" name="mrova-sendbutton">
</form>
</div>
<div id="mrova-img-control"></div>
</div>