개발! 딱 깔끔하고 센스있게!

PHP 폼 제출 본문

개발 스크랩 메모/PHP

PHP 폼 제출

렉사이 2020. 12. 23. 22:39

나는 만든 양식이 문제가 있다.

기본적으로 수신자에게 이메일을 보내는 것은 허용하지 않습니다.

PHP 코드가 정확하다고 해도 됩니다.

PHP 코드를 깎는 질문인가요?

[email protected]"; $name = trim($_POST['name']); $email = trim($_POST['email']); $comments = trim($_POST['comments']); $subject = "Contact Form"; $messages = "Name: $name \r\n Email: $email \r\n Comments: $comments"; $headers = "From:" . $name; $mailsent = mail($to, $subject, $message, $headers); if ($mailsent) { $sent = true; } } } ?> 

나의 HTML 은:

 

Text

Text

Contact Me!

대답

이것을 시험해 보세요. (몇 가지 문제를 해결해야 합니다):

[email protected]"; $name = trim($_POST['name']); $email = trim($_POST['email']); $comments = trim($_POST['comments']); $subject = "Contact Form"; $message = "Name: $name \r\n Email: $email \r\n Comments: $comments"; $headers = "From:" . $name; $mailsent = mail($to, $subject, $message, $headers); if($mailsent) { $sent = true; } } } ?>  

Text

Text

Contact Me!

Comments