donglu9978 2013-03-21 08:48
浏览 22
已采纳

PHP重定向不适用于IE?

I try to put script to send an email and redirect to main page. yes, it's work! but...

On IE, it doesn't work.

code example:

<?php
if(isset($_POST['email'])) {

    // EDIT THE 2 LINES BELOW AS REQUIRED
    //$email_to1 = "a@abc.com";
    $email_to2 = "b@abc.com";
    $email_subject = "Email from www.abc.com";         
    ................
    ................                  
    // create email headers
    $headers = 'From: '.$email_from."
".
    'Reply-To: '.$email_from."
" .
    '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
}
?>

How could i solve it?

  • 写回答

3条回答 默认 最新

  • donxbje866688 2013-03-21 09:01
    关注

    Please use below code

      header('Location:http://www.abc.com/Contact.html')
        exit;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 用三极管设计一个单管共射放大电路
  • ¥20 fluent无法启动
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架