<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$website = $_POST['website'];
$message = $_POST['message'];
$mail_to = '[email protected]';
$subject = 'Message from a site visitor '.$subject;
$body_message = "From: $name\n";
$body_message .= "E-mail: $email\n";
$body_message .= "Phone: $phone\n";
$body_message .= "Priority: $priority\n";
$body_message .= "Type: $type\n";
$body_message .= "Website: $website\n";
$body_message .= "Message: $message";
$headers = "From: $email";
$headers .= "Reply-To: $email";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact_page.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please try ');
window.location = 'contact_page.html';
</script>
<?php
}
?>
이것은 PHP 파일이지만 시도 할 때마다 메시지를받을 수 있지만 입력 값은 포함되어 있지 않습니다.이 PHP를 문의 양식에 사용하고 있는데 입력을 인식하지 못합니다.
수신 된 이메일처럼 보이는이
From:
E-mail:
Phone:
Priority:
Type:
Website:
Message:
누군가가 내 문제를 도와 줄 수 있습니까?
감사합니다.
이 함께가는 HTML을 게시하시기 바랍니다 .. 대신
$_POST
의$_REQUEST
와sprintf
를 사용하여 좀 덜 보안 해제를 시도 할 수 . –나는 마이크 밑에 html을 올렸다. – user2869403
감사합니다.하지만 아마도 조금 늦었습니다. –