0
新手尋求建議,將不勝感激,如果有人可以幫助我!電子郵件表單詳細信息的最佳方式是什麼?
所以,我有我的網站上簡單的形式:
<form id="quote" method="post" class="contact" action="mail.php">
<fieldset>
<div id="form_name">
<label for="name" class="fixedwidth"> Please enter your full name:</label>
<input id="name" name="name" type="text" required aria-required="true" autofocus>
</div>
<div id="form_mail">
<label for="email" class="fixedwidth"> Please enter your email address:</label>
<input id="email" name="email" type="email" required aria-required="true">
</div>
<div id="form_tel">
<label for="tel" class="fixedwidth">Please enter you phone number:</label>
<input id="tel" name="tel" type="tel" required aria-required="true" >
</div>
<div id="form_message">
<label for="message" class="fixedwidth"> Leave a message:</label>
<textarea id="message" name="message" cols="20"rows="7"></textarea>
</div>
<div id="form_submit">
<input type="submit" value="Submit">
</div>
我想詳細電郵到自己。我使用mail.php此:
<?php
$myemail = "[email protected]";
$name = $_POST['name'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$message = $_POST['message'];
$subject = 'Website query';
$body = "Name: $name E-mail: $email Telephone Number: $tel Subject: $subject Message: $message";
mail($myemail, $subject, $body);
?>
當用戶點擊「提交」按鈕,我想您迴應出現在形式和下面的表單感謝被清除。
任何人都可以幫我解決這個問題嗎?
非常感謝!
感謝您的回覆。頁面無法重新加載,所以我想我必須深入研究Javascript和AJAX。 –