我有一個聯繫表格在http://www.brisbanediveacademy.com.au使用php。我試圖在表單提交後重定向到iframe中的新頁面。目前我無法將它重定向到任何地方。聯繫表格iframe重定向
這是我的PHP
<?php
$errors = '';
$myemail = '[email protected]';
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$contact = $_POST['number'];
$inquiry = $_POST['inquiry'];
$email_address = $_POST['email'];
$message = $_POST['message'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}
if(empty($errors))
{
$to = $myemail;
$email_subject = "Website contact Form Enquiry: $inquiry";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n Email: $email_address \n Contact Number: $contact \n Message: \n $message";
$headers = "From: $myemail\n";
$headers = "Reply-To: $email_address";"\r\n";
mail($to,$email_subject,$email_body,$headers);
}
?>
任何幫助將是巨大的。
感謝
這裏是重定向代碼? –
我已檢查過您的網站。問題是在設置標題重定向之前,您有空白空間或打印某些內容。在打印頁面上的任何內容之前,刪除這些空格或行並設置標題。 –
你能舉一個例子對不起,不是100%確定你的意思。我在那裏有重定向,但最近把它們取出來了。 –