|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-03-12 06:12 UTC] muffle at immortalcurse dot com
This bug affects how variables are parsed from the URL, in instances when the header() function is used to forward the browser. Eg. if the following code was used in a script:
header("Location: index.php?variable=blah")
Then index.php would be parsed and PHP would assign $variable == blah. However, if the user adds a HTML anchor reference onto the end, eg:
header("Location: index.php?variable=blah#1")
Then the web browser would still parse it fine, but PHP will assign $variable == blah#1. If the user refreshes the browser window (eg., the location header isn't being used to laod the script) then it works fine, so this bug is limtied to the header() function only.
Fix:
The script writer can add an & before the # character in the URL, eg:
index.html?variable=blah
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
I get this bug too. I can literally do; [php]echo $forum_properties['base_url']."/thread/$tid/$pages#$pq->pid"; header("Location: ".$forum_properties['base_url']."/thread/$tid/$pages#$pq->pid"); success_box('Post Added', "index/thread/$tid/$pages#$pq->pid");[/php] results in [php]//http://forumz.wuggawoo.co.uk/index/thread/5/5#6890 //redirects to [url]http://forumz.wuggawoo.co.uk/index/thread/5/5[/url] //redirectrs to [url]http://forumz.wuggawoo.co.uk/index/thread/5/5#6890[/url][/php] I tried the &# solution but it didnt work, it just goes to /&