php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11564 Passing variables using the GET method
Submitted: 2001-06-19 12:18 UTC Modified: 2001-06-19 18:39 UTC
From: chaz at ro0t dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.5 OS: Win32
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chaz at ro0t dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-19 18:39 UTC] cnewbill@php.net
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
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 00:01:29 2025 UTC