|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28221 Query_String doesn't work if last var is blank
Submitted: 2004-04-29 20:55 UTC Modified: 2004-05-05 22:26 UTC
From: haldous2 at yahoo dot com Assigned:
Status: No Feedback Package: URL related
PHP Version: 4.3.4 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: haldous2 at yahoo dot com
New email:
PHP Version: OS:


 [2004-04-29 20:55 UTC] haldous2 at yahoo dot com
If last var is blank, no query_string is produced. This is running on a dell server with apache web server on linux

This will produce 
$_GET['var1'] = nothing! 
$_GET['var2'] = nothing! 
$_GET['var3'] = nothing! 

This will produce 
$_GET['var1'] = a 
$_GET['var2'] = b 
$_GET['var3'] = c 

This is really annoying since it has worked on 2 other servers that I have used. am I missing something? I've done some research and found that globals is ON, but with $_GET it doesn't matter if it's ON. 

What am I missing here? 

Also, there is no way I can POST these vars. I have certain pages with text links that I cannot process with a POST.

Here is a live test link to help you visualize the problem 
go to:

Reproduce code:
print "var1 = ".$_GET['var1']."<br>";
print "var2 = ".$_GET['var2']."<br>";
print "var3 = ".$_GET['var3']."<br>";
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
This screen is to test in inadequecies of php on<br><br>

<a href="testget.php?var1=a&var2=b&var3=c">link1 (good)</a>&nbsp;var1=a var2=b var3=c<br>
<a href="testget.php?var1=a&var2=b&var3=">link2</a>&nbsp;var1=a var2=b var3=<br>
<a href="testget.php?var1=&var2=b&var3=c">link3</a>&nbsp;var1= var2=b var3=c<br><br>

If you know how to fix this please let me know! go to <a href="" target="_blank"></a>


Expected result:
link 1: var1=a var2=b var3=c
link 2: var1=a var2=b var3=
link 3: var1= var2=b var3=c

Actual result:
link 1: var1=a var2=b var3=c
link 2: var1= var2= var3=
link 3: var1= var2=b var3=c

Link 3 is used to verify that if the last var has data the query string sends these three variables.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-05 22:26 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 23:03:36 2021 UTC