Forum Moderators: coopster
I asked about this problem like 6 months ago but didnt reach a solution and i ignored it, but now while writing some script i needed to use it again!
So the problem is that this line down works fine with firefox but in IE6 & 7 it just goes to the url ignoring anything from # till end so it just goes to the url without jumping to the internal link but if i manually added the internal link in the url.. it will normally go to it! but the strange thing is that same line worked in other php files on same server!
PHP version 5.1.2
header("Location: h**p://www.mysite.se/somefile#a");
also doesnt work in any of the following cases!
-----------------------------------------------
header("Location: h**p://www.mysite.se/somefile.htm#a");
-----------------------------------------------
$h = '#a';
$url = $_SERVER['HTTP_REFERER'].$h;
session_write_close();
header("Location: ".$url);
exit;
---------------------------------------------
But all works in firefox!
Thanks in advance
It didnt work because the problem is not in the HTML page, if i write it manually then it goes there..
The problem is that when i redirect to this url:
www.mysite.com/page#a
it just goes to:
www.mysite.com/page ignoring the #a
so this let me say its bug in PHP but since it works in Firefox so that makes me say its bug in IE but because it works well in Firefox & IE in other pages that i have on same server so it makes me clueless!
However, I just ran a test header() redirection with a fragment identifier and it worked just fine in both FF and MSIE. The new page was loaded and both browsers took me to the point halfway down the HTML document where the named anchor existed.