|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-06-19 12:18 UTC] chaz at ro0t dot com
<?
if($name) {
echo $name;
}else{
echo "<a href=\"$PHP_SELF?name=#asdf\">Click me</a>";
}
?>
When you click on 'Click Me', it displays the link again, when it should output '#asdf'. This does not happen using the POST method.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 21:00:02 2025 UTC |
This is a browser issue, since it uses # as the key that it needs to go that particular anchor of a page. Use urlencode when passing variables in the URL like that. <? if($name) { echo $name; }else{ echo "<a href=\"$PHP_SELF?name=".urlencode("#asdf")."\">Click me</a>"; } ?> -Chris