php.net |  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
Have you experienced this issue?
Rate the importance of this bug to you:

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

page.php?var1=a&var2=b&var3= 
This will produce 
$HTTP_SERVER_VARS['QUERY_STRING']; = nothing! 
$_GET['var1'] = nothing! 
$_GET['var2'] = nothing! 
$_GET['var3'] = nothing! 

page.php?var1=a&var2=b&var3=c 
This will produce 
$HTTP_SERVER_VARS['QUERY_STRING']; = nothing! 
$_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: 
http://www.allmeetup.com/testget.php

Reproduce code:
---------------
<?
print "var1 = ".$_GET['var1']."<br>";
print "var2 = ".$_GET['var2']."<br>";
print "var3 = ".$_GET['var3']."<br>";
?>
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
This screen is to test in inadequecies of php on lunarpages.com<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="http://www.allmeetup.com/contactus.php" target="_blank">http://www.allmeetup.com/contactus.php</a>

</BODY>
</HTML>

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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-05 22:26 UTC] sniper@php.net
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: Wed Jul 28 12:01:23 2021 UTC