internet explorer - PHP header redirection does not work on IE 8

603

A redirection under php:

header("Location: mask.php")

does work with IE 9, google chrome, firefox, but not with IE 8.

How can I fix this?

PS:header("Location: http://......") does not help.

430

Answer

Solution:

You lack; at the end end you need toexit your script so no script is executed anymore.

<?php
    header("Location: mask.php");
    exit; // with die at the end
?>

To test onIE make a sample page that redirects someplace and test on NetRenderer

551

Answer

Solution:

Adddie(); after.

Like:

header("Location: mask.php");
die();
885

Answer

Solution:

I just had this issue and this post still comes up in Google. The solution that worked for me was to include the www in the URL.

Example:

header("Location: http://www.example.com/mask.php");
exit();

Cheers.

People are also looking for solutions to the problem: php - Symfony 2 FOS UserBundle users doesn't get group's role

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.