|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16659 href parameters failing
Submitted: 2002-04-17 09:41 UTC Modified: 2002-04-18 08:50 UTC
From: alistair at maclean-nj dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.2.0 OS: Linux 2.4.18
Private report: No CVE-ID: None
 [2002-04-17 09:41 UTC] alistair at maclean-nj dot com
Built 4.2.0RC4 with Apache 2.0.35
Build files below.

Testing an existing site I noticed that I was dropping parameters passed between pages.

Using an anchor like: 
<a href="somepage.php?valuea=something">Click me</a>

An code in the other page like:
    echo "value=:".$valuea.":";

Is not return the expected output (value=:something:)
Instead I get (value=::)

It looks like the name/value pair is being lost.
I have attached two test pages. These work in Apache 1.3.20/PHP 4.1.2.

There seem to be no errors in the apache logs. - - [17/Apr/2002:09:02:30 -0400] "GET /php/atest.php HTTP/1.1" 200 117 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311" - - [17/Apr/2002:09:02:32 -0400] "GET /php/btest.php?value1=first HTTP/1.1" 200 96 "http://localhost/php/atest.php" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311"


./configure \
"--with-layout=RedHat" \
"--enable-shared=max" \
"--enable-rule=SHARED_CORE" \
"--enable-info" \
"--disable-userdir" \
"--enable-so" \
"--enable-vhost-alias" \
"--enable-cgi" \
"--enable-ssl" \
"--enable-usertrack" \
"--enable-unique-id" \


./configure --with-mysql=/usr --enable-trans-sid  --with-apxs2                                        

Test code :atest.php
      $value1 = "first";
      echo "<a href=\"btest.php?value1=$value1\">Test With 1</a>";

Test Code: btest.php
        <title>Test Second Page</title>
   echo "First Param = :".$value1.":";



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-17 09:45 UTC] alistair at maclean-nj dot com
Sorry, cat ran over keyboard before I grammar checked this.

corrected lines:
   And code in the other page like:
   Is not returning the expected output (value=:something:)
 [2002-04-17 10:03 UTC]
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit

Hint: use $_GET['valuea'] or set register_globals to on
 [2002-04-17 14:25 UTC] alistair at maclean-nj dot com
While I agree these might work (thought they don't) this is not a support question, this is a bug!

I am working with Apache 2.0.35 and PHP 4.2.0 RC4 compiled as a DSO. The behaviour I am describing occurs as described. The behaviour is different to that I get with the same modules under my production systems using Apache 1.3.20/PHP 4.1.2.

The php.ini file has register_globals set on. (the default it would seem) (I am assuming it is reading the version in /etc/php.ini)

The $_GET does no better than the use of global variables. 

Have I tripped up over some compile option that is amusing the gods? 

 [2002-04-17 15:08 UTC]
Try a print_r($_GET); does it show anything?
If it does show the variables, then your problem is that PHP reads /usr/local/lib/php.ini (default) and not /etc/php.ini (only default with special ./configure option). See the phpinfo(); output for more.
 [2002-04-17 15:43 UTC] alistair at maclean-nj dot com
Copied over php.ini-recommended to /usr/local/lib and renamed to php.ini.

Edited register_globals (as it is defaulted to Off in this file) and restarted.

App now seems to function as expected.

Was the php.ini meant to be copied over by me, or by the "make install"?
 [2002-04-17 15:47 UTC] robert at webmotion dot com
By you, otherwise every recompile or upgrade would
clobber your php.ini file :)
 [2002-04-18 08:50 UTC]
user error -> bogus
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 22:01:29 2024 UTC