我尝试将脚本发送电子邮件并重定向到主页面。是的,这是工作!但...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