CSS y我的聯繫表單的PHP。 該網頁完美的工作,但我想發送一封電子郵件和發送按鈕不起作用。在圖片中,您可以看到,當我嘗試發送電子郵件時,按鈕保持白色。同時按鈕清除工作完美!我附上我的代碼聯繫人html和郵件php之間的差異連接php
CONTACT.HTML
<form action="mail.php" method="POST" class="contact-form">
<input type="text" name="name" placeholder="Name" class="required">
<input type="email" name="email" placeholder="Email address" class="contact-form-email required">
<input type="text" name="subject" placeholder="Subject" class="contact-form-subject">
<textarea name="message" placeholder="Message" class="required" rows="7"></textarea>
<div class="response-message"></div>
<button class="border-button" type="reset" id="reset" name="reset">Limpiar</button>
<button class="border-button" type="submit" id="submit" name="submit">Enviar</button>
MAIL.PHP
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "sa*********@*******.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
對不起,目前尚不清楚你在問什麼。你的代碼片段之間有什麼線索?什麼不工作? – Heri