When a user completes the Survey Form, the Fragment Identifier is added to the URL like this...
While validating the $_POST data - and before any output occurs - if there is an error, I would place some error codes in the $_SESSION, and then redirect as follows...
// Redirect to Outcome Page.
header("Location: " . BASE_URL . "/account/results.php");
So it seems strange to me that when the error page is displayed I see something like this...
I would NOT expect the Fragment Identifier to carry over to my Error Page when it was in no way passed by me in either the URL or by other means...
P.S. Since these types of errors should in theory never occur because other code (e.g. validation) would prevent the errors from happening, it isn't the end of the world. At the same time, I like to keep my URLs (and code) clean and working 100% right, so if I could figure this glitch out it would make me sleep better!