ID: 25804 Updated by: [EMAIL PROTECTED] Reported By: greg at freephile dot com -Status: Open +Status: Bogus Bug Type: HTTP related Operating System: RH Linux 8.0 PHP Version: 4.3.3 New Comment:
Browsers never send this part of URI to the server so there is no way it can be "captured". Previous Comments: ------------------------------------------------------------------------ [2003-10-09 09:31:52] greg at freephile dot com Description: ------------ When a URI includes a fragment, that fragment is not captured as part of the $_SERVER['REQUEST_URI'] variable, so it is not possible to use parse_url() to get the fragment. As an example, the following request will NOT have the fragment in the $_SERVER['REQUEST_URI'] variable: http://www.freephile.com/admin/test.php?foo=bar#fragment Instead, the $_SERVER['REQUEST_URI'] is given as '/admin/test.php?foo=bar' I use PHP to process outgoing site links on http://www.buzgate.org, but due to this problem, I cannot redirect to external URIs containing a fragment. The workaround is to recode those URIs into two querystring variables and then reconstruct the URI: to=http://somewhere.com/somepage.html&fragment=named_anchor $externalSiteURI = $_REQUEST['to'] . $_REQUEST['fragment']; Reproduce code: --------------- See http://www.freephile.com/admin/test.php?foo=bar#fragment and http://buzgate.org/referral.php?to=http://www.sba.gov/library/pubs.html#success4 (this link may be fixed with a workaround by the time you get this message) Expected result: ---------------- $_SERVER['REQUEST_URI'] = '/admin/test.php?foo=bar#fragment' Actual result: -------------- $_SERVER['REQUEST_URI'] = '/admin/test.php?foo=bar' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25804&edit=1