0
我想創建一個簡單的消息表單使用navigateToURL()和PHP郵件()。但是我在php頁面中重定向這種方法時遇到了問題。我需要它不要重定向頁面,但仍然發送到電子郵件。Flash AS3 navigateToURL()和PHP郵件()
這就是我所做的。
AS3
if (e.type == "click")
{
navigateToURL(new URLRequest("http://somedomain.com/sendme.php?" + "name=" + e.currentTarget.parent.na_txt.text + "&email=" + e.currentTarget.parent.ma_txt.text + "&contact=" + e.currentTarget.parent.co_txt.text + "&message=" + e.currentTarget.parent.me_txt.text + "&sex=" + e.currentTarget.parent.sex), "_self");
}
PHP
<?php
$to = "[email protected]";
$subject = "Subject";
$name = $_GET['name'];
$sex = $_GET['sex'];
$email = $_GET['email'];
$contact = $_GET['contact'];
$message = $_GET['message'];
// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.email."\r\n" .
'X-Mailer: PHP/' . phpversion();
$body = "From: $name \r\nGender: $sex \r\nE-Mail: $email \r\nContact No.: $contact \r\n\r\nMessage:\n$message";
echo "Thank You $name, Your Feedback and Enquiry has been submitted to <a href='mailto:$to'>$to</a>!";
mail($to, $subject, $body, $headers);
?>
感謝您的幫助..是的,它解決了我的問題。謝啦! – Pennf0lio