php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24554 Lost anchor in header redirect
Submitted: 2003-07-08 22:49 UTC Modified: 2003-07-09 07:42 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: nisanov at bigpond dot net dot au Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.1 OS: Windows 2000
Private report: No CVE-ID: None
 [2003-07-08 22:49 UTC] nisanov at bigpond dot net dot au
Description:
------------
I'm not sure if this is the same but that is talked about in Bug #6178: URI Re-writing failure but there is comments of this being fixed in php v4.0.2 and I am using php v4.3.1

I have a page that containts a form with enctype="multipart/form-data" - used to upload an image

The form data is sent to a 2nd page that writes the image data into a database.

In the 2nd page I also have a header function that contains an anchor reference (#MyAnchor);

When the header source page loads the anchor disappears from the url.

This only happens when I post from a form that has enctype=multipart/form-data.  I cannot be certain this is the cause but I have some suspicions that it is.

Any ideas?

Reproduce code:
---------------
header("Location: search.php?SID=".$_GET["SID"]."&msg=56&restore=true#UserDetails");
exit;


Expected result:
----------------
The url address in the browser to be:

http://mysite/search.php?SID=j54b23l45b2lk45b24j5b2asdf&msg56&restore=true#UserDetails

Actual result:
--------------
The url address in the browser is:

http://mysite/search.php?SID=j54b23l45b2lk45b24j5b2asdf&msg56&restore=true

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-09 07:42 UTC] sniper@php.net
This can't be any PHP bug. And RTFM:
"Note: HTTP/1.1 requires an absolute URI as argument to 
Location: including the scheme, hostname and absolute path.."


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 04:03:36 2021 UTC