Page 1 of 1

$_REQUEST in php 5.0.2 vs php 5.1.2

Posted: Wed Apr 19, 2006 12:22 am
by rkgordon3
I wrote some code in an apache 2/php 5.1.2 environment
and it worked just peachy.

I then moved it to an apache 1.3.27/php 5.0.2 environment
and it did NOT work.

Both environments were on windows systems (XP in former
case, 2000 in latter case).

The problem is that $_REQUEST is not getting populated
as expected in 1.3.27/5.0.2 environment.

The following code exhibits the problem I am seeing with
$_REQUEST:

Code: Select all

foreach  (array("_GET", "_REQUEST","_POST") as $src) {
echo $src."<br/>";
 foreach (${$src} as $idx => $value) {
 echo $idx ."=".$value."<br/>";
 };
};
When form is POSTed to this code in 2.0/5.1.2, all is well.
Same code in 1.3.27/5.0.2 environment, and the $_REQUEST
array is empty.

My two php environments _appear_ to be configured properly
(per phpinfo) and nothing looks out of wack with apache configs
so I am stumped.

Is there a config paramter I am missing? Is this a bug? Am
I missing something simple?

Thanks
Rob

Posted: Wed Apr 19, 2006 12:27 am
by hawleyjr
Have you done a print_r to see the $_REQUEST var?

Posted: Wed Apr 19, 2006 12:45 am
by rkgordon3
I have now.

In the case of a POSTed form only
the PHPSESSID appers in _REQUEST array.

In the case of a GETed form, all appears
as would be expected.

I did this in 1.3.27/5.0.2 environment b/c that is
where I am getting unexpected behavior.

Rob

Posted: Wed Apr 19, 2006 12:57 am
by feyd

Posted: Wed Apr 19, 2006 1:13 am
by rkgordon3
That, I have done. Both are GPCS.

The other php config issue I looked into (grabbing at
straws, perhaps, but that is what neophytes do) was
the register_globals settings. Both are 'on'

Rob

Posted: Wed Apr 19, 2006 2:22 am
by Chris Corbyn
rkgordon3 wrote:register_globals settings. Both are 'on'
I'm not 100% neither if this affects REQUEST but in any case I'd suggest you turn that off... it's bad.

Posted: Wed Apr 19, 2006 2:27 am
by rkgordon3
Believe me, I know it is bad. Unfortunately, the deployment target
environment (apache 1.3.27/php 5.0.2) has this setting.

It is a legacy of previous PHP developer. I don't dare change
it now with all the other PHP apps, about which I know nothing,
running.

Rob