rather odd firefox/php header/html anchor problem

Soldato
Joined
6 Feb 2004
Posts
20,874
Location
England
i have a little php script and at the top i have a processing section which works on $_POST form variables. at the end of the processing i use

Code:
$here = 'http://domain/folder/';
header("Location: $here");

i just do this to stop any problems with people using the back button in the browser.

recently i've introduced html anchors into my page and this is the problem - even though i'm using header location as above, the anchor tag is persisting when using firefox - works fine in ie7. even though i'm hardcoding the redirect, firefox is keeping the anchor in it's address bar. wtf is going on? :confused: :p
 
Is the redirect actually happening in Firefox? Have you got full error_reporting on, and there are no 'headers already sent' errors?

Try adding an exit; or die; after sending headers, otherwise the script will continue processing and may display the rest of the page causing the redirect to fail.

Code:
$here = 'http://domain/folder/';
header("Location: $here");
exit;
 
i've already got "exit;" in place and the script/header direction itself works fine. it just leaves the previous #anchor on the end of the url in the adddress bar in firefox only. :confused:
 
Back
Top Bottom