Bug 72551

Summary: URL arguments do not get passed to a php program.
Product: [Retired] Red Hat Public Beta Reporter: Pedro Soria-Rodriguez <sorrodp>
Component: phpAssignee: Phil Copeland <copeland>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: null   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-27 18:56:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output from "test.php" when run with key=3 as an argument none

Description Pedro Soria-Rodriguez 2002-08-25 09:33:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722

Description of problem:
I have found that the arguments passed through a URL to a php app do not reach
my php code.

The code for a "test.php" program is
    <?php
    echo "value of key: zzz" . $key . "xxx<br>\n";
    phpinfo();
    ?>

When called with the URL "test.php?key=3", the output result is:
     value of key: zzzxxx
instead of the expected:
     value of key: zzz3xxx

The call to phpinfo() returns these:
_GET["key"]                  3 
_SERVER["REQUEST_METHOD"]    GET
_SERVER["QUERY_STRING"]      key=3
_SERVER["REQUEST_URI"]       /test.php?key=3 
_SERVER["SCRIPT_NAME"]       /test.php 
_SERVER["PHP_SELF"]          /test.php 
_SERVER["argv"]              Array
                             (
                               [0] => key=3
                             )

_SERVER["argc"]              1 

The full output from phpinfo is included in the attached file "test.php.html". 
  You will see that I accessed the server remotely, but I obtained the same
result accessing it locally (on the same machine).



Version-Release number of selected component (if applicable):
# rpm -q php
php-4.2.2-9


How reproducible:
Always

Steps to Reproduce:
Simply run the program test.php?key=3  through the apache web server again.


Additional info:

Comment 1 Pedro Soria-Rodriguez 2002-08-25 09:34:14 UTC
Created attachment 72824 [details]
Output from "test.php" when run with key=3 as an argument

Comment 2 Pedro Soria-Rodriguez 2002-08-25 09:36:50 UTC
The attachement test.php.html shows that I direct error messages to 
/tmp/php.errors.txt,   but when I found the bug described above, the
php.errors.txt file does not show any messages.



Comment 3 Stu Tomlinson 2002-08-26 04:49:04 UTC
Not a bug - since PHP 4.2.0, external parameters are not by default registered as
global variables. See the Warning box on this page:
http://www.php.net/manual/en/language.variables.predefined.php

You should either set "register_globals = on" in /etc/php.ini, or (preferred)
switch to the new superglobal arrays (eg. $_GET['key'] )

Comment 4 Phil Copeland 2002-08-27 18:56:44 UTC
*** Bug 72752 has been marked as a duplicate of this bug. ***

Comment 5 Phil Copeland 2002-08-31 06:39:49 UTC

*** This bug has been marked as a duplicate of 72752 ***