From:             haldous2 at yahoo dot com
Operating system: windows 2000
PHP version:      4.3.4
PHP Bug Type:     URL related
Bug description:  Query_String doesn't work if last var is blank

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.

-- 
Edit bug report at http://bugs.php.net/?id=28221&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28221&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28221&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28221&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28221&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28221&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28221&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28221&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28221&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28221&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28221&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28221&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28221&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28221&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28221&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28221&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28221&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28221&r=float

Reply via email to