$_REQUEST in php 5.0.2 vs php 5.1.2

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rkgordon3
Forum Newbie
Posts: 6
Joined: Tue Mar 14, 2006 10:52 pm

$_REQUEST in php 5.0.2 vs php 5.1.2

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Have you done a print_r to see the $_REQUEST var?
rkgordon3
Forum Newbie
Posts: 6
Joined: Tue Mar 14, 2006 10:52 pm

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

rkgordon3
Forum Newbie
Posts: 6
Joined: Tue Mar 14, 2006 10:52 pm

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
rkgordon3
Forum Newbie
Posts: 6
Joined: Tue Mar 14, 2006 10:52 pm

Post 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
Post Reply