0
내 인덱스<button> 태그로 HTML 양식이 작동하지 않는 이유는 무엇입니까?
<form id="contactus" action="mail.php" method="POST">
<input type="text" name="fname" id="name" placeholder="Your name"><br>
<input type="text" name="phone" id="phone" placeholder="Phone"><br>
<div class="mybtn">
<button type="submit" value="submit" form="contactus" class="button">Submit</button>
</div>
</form>
그리고 mail.php
<?php
$name = $_POST['fname'];
$phone=$_POST['phone'];
$formcontent="From: $name \n Message: $phone";
$recipient = "[email protected]";
$subject = "Email header";
mail($recipient,$subject, $formcontent);
?>
의 내용하지만, 내가 어떤 이메일을 수신하지 못하는 경우 일 것 같지 않습니다.
단지 시도 할 때 mail($email, $header, $content)
메시지가 수신되어 양식과 만 작동하지 않습니다.
EDIT : mail.log 파일을 확인했는데 이메일을 보내지 않은 기록이 없습니다.
EDIT 2 : 문제를 발견했습니다. <button>
입니다. 내가 그것을 <input type="submit">
으로 바꿨을 때 그것은 작동하기 시작했다. 비록 그것이 <button>
과 함께 작동하지 않는 이유는 모르지만.
입니다. 오류가 표시되는 이유는 무엇입니까? 또는 오류 로그? – Efx
@Efx 오류가 없습니다. 이메일을받지 못했습니다. – kulan
오류보고를 사용하도록 설정 했습니까? @Qirel의 링크를 확인하실 수 있습니다 – Efx