我嘗試將腳本發送電子郵件並重定向到主頁面。是的,這是工作!但...PHP重定向不適用於IE?
在IE上,它不起作用。
代碼示例:
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
//$email_to1 = "[email protected]";
$email_to2 = "[email protected]";
$email_subject = "Email from www.abc.com";
................
................
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
//@mail($email_to1, $email_subject, $email_message, $headers);
@mail($email_to2, $email_subject, $email_message, $headers);
header("Refresh: 3; http://www.abc.com/Contact.html");
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.<br>
<a href="http://www.abc.com/Contact.html">back to website</a>
<?php
}
?>
我怎麼能解決呢?
您是否嘗試使用exit()函數退出頭部函數之後的腳本; ? – 2013-03-21 08:50:09
使用這裏找到的:http://en.wikipedia.org/wiki/Meta_refresh(' Najzero 2013-03-21 08:52:06
@Stoyan Dimov是的,試試吧。 – fronthem 2013-03-21 09:00:10