我知道这个问题很多,但我只是不知道如何使用已经回复的帖子来解决这个问题。当我发送邮件时,页面上会出现一个弹出框,就像这样。< / p>
Call Stack
# Time Memory Function Location
1 0.0010 250912 {main}( ) ...\contact.php:0
2 0.0010 251736 mail ( ) ...\contact.php:15
我的代码看起来像这样
<?php
if(isset($_POST["submit"]))
{
$to = "email@example.com";
$email = $_POST['contact-email'];
$subject = $_POST['contact-subject'];
$message = "Name: ".$_POST["contact-name"]."";
$message .= "Number: ".$_POST["contact-number"]."";
$message .= "Message: ".$_POST["contact-message"]."";
$headers = 'From:'. $email . "\r\n"; // Sender's Email
$message = wordwrap($message, 70);
mail($to, $subject, $message, $headers);
echo "Your mail has been sent successfuly ! Thank you for your feedback";
}
?>
<form class="contact-form" method="post" action="">
<h4>Drop us a line</h4>
<div class="col-md-6"> <span>Enter Your Name* </span>
<input name="contact-name" placeholder="Name" type="text">
</div>
<div class="col-md-6"> <span>Enter Your Email*</span>
<input name="contact-email" placeholder="E-Mail" type="email">
</div>
<div class="col-md-6"> <span>Enter Your number</span>
<input name="contact-number" placeholder="Number" type="text">
</div>
<div class="col-md-6"> <span>Enter Your Subject</span>
<input name="contact-subject" placeholder="Subject" type="text">
</div>
<div class="col-md-12"> <span>Enter Your Message</span>
<textarea name="contact-message" placeholder="Write your message"></textarea>
</div>
<div class="text-center">
<input class="form-send" value="Send Message" type="submit" name="submit">
</div>
</form>
我在localhost上测试它。我希望从中克服它,我不知道它是否会在现场显示...