redirect doesn't work
This question already has an answer here:
From PHP documentation :
header()
must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
And in your case, you are using echo
before header()
I reminded myself that I had xDebug installed on the actual test environment and after googling it, I found this site: http://bugs.xdebug.org/view.php?id=532
So I'll downloaded the last version of xDebug and changed the php.ini accordingly for the new file and everything works out like a charm. Headers are being sent - the redirecetion is done and errors are displayed.
Thanks everybody for your help!
Do you have short tags enabled? try it with the long tag <?php
:
<?php
error_reporting(E_ALL);
header("Location: login.php");
die();
?>
链接地址: http://www.djcxy.com/p/71884.html
下一篇: 重定向不起作用