From: Brian Dunning on
I'm trying to write a VERY simple script that does nothing but store all the submitted GET and POST vars in a string and echo it out.

$response = print_r($_REQUEST, true);
echo $response;

The problem is it only shows GET vars. I've tried $POST instead of $_REQUEST and it always gives an empty array. I've got it on two different servers, and we have three guys trying various methods of submitting forms to it, trying to eliminate all potential problems, like the possibility that the request might not actually have any POST vars. I think we've safely eliminated these possibilities.

Can anyone see a reason why the above should not see POST vars? Is there some security setting I don't know about?
From: Ashley Sheridan on
On Wed, 2010-08-18 at 13:45 -0700, Brian Dunning wrote:

> I'm trying to write a VERY simple script that does nothing but store all the submitted GET and POST vars in a string and echo it out.
>
> $response = print_r($_REQUEST, true);
> echo $response;
>
> The problem is it only shows GET vars. I've tried $POST instead of $_REQUEST and it always gives an empty array. I've got it on two different servers, and we have three guys trying various methods of submitting forms to it, trying to eliminate all potential problems, like the possibility that the request might not actually have any POST vars. I think we've safely eliminated these possibilities.
>
> Can anyone see a reason why the above should not see POST vars? Is there some security setting I don't know about?


Is there any code before the print_r() call, i.e. code that might be
setting it to an empty array?

If not, then are you sure your form is definitely sending post
variables? It sounds a stupid question, but a small typo could be
sending the data as GET by accident. Firefox has a useful extension
called Firebug which might be able to show you the data being sent to
the browser. If you really need to bring out the big guns, then
Wireshark will show all the network traffic, including that sent from
your form to the server.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Marc Guay on
> $response = print_r($_REQUEST, true);
> echo $response;

I'm sorry I don't have any input on your actual question but tohuhgt
I'd mention that this can be shortened to:

print_r($_REQUEST);

.... if I'm not mistaken.

Marc
From: Brian Dunning on
Sorry, my typo, $_POST is one of the options we tried, not $POST. It returns an empty array also.



On Aug 18, 2010, at 1:50 PM, Joshua Kehn wrote:

> On Aug 18, 2010, at 4:45 PM, Brian Dunning wrote:
>
>> I'm trying to write a VERY simple script that does nothing but store all the submitted GET and POST vars in a string and echo it out.
>>
>> $response = print_r($_REQUEST, true);
>> echo $response;
>>
>> The problem is it only shows GET vars. I've tried $POST instead of $_REQUEST and it always gives an empty array. I've got it on two different servers, and we have three guys trying various methods of submitting forms to it, trying to eliminate all potential problems, like the possibility that the request might not actually have any POST vars. I think we've safely eliminated these possibilities.
>>
>> Can anyone see a reason why the above should not see POST vars? Is there some security setting I don't know about?
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> You have to use $_POST for the post data.
>
> Regards,
>
> -Josh
> ____________________________________
> Joshua Kehn | Josh.Kehn(a)gmail.com
> http://joshuakehn.com
>

From: Adam Richardson on
On Wed, Aug 18, 2010 at 4:49 PM, Ashley Sheridan
<ash(a)ashleysheridan.co.uk>wrote:

> On Wed, 2010-08-18 at 13:45 -0700, Brian Dunning wrote:
>
> > I'm trying to write a VERY simple script that does nothing but store all
> the submitted GET and POST vars in a string and echo it out.
> >
> > $response = print_r($_REQUEST, true);
> > echo $response;
> >
> > The problem is it only shows GET vars. I've tried $POST instead of
> $_REQUEST and it always gives an empty array. I've got it on two different
> servers, and we have three guys trying various methods of submitting forms
> to it, trying to eliminate all potential problems, like the possibility that
> the request might not actually have any POST vars. I think we've safely
> eliminated these possibilities.
> >
> > Can anyone see a reason why the above should not see POST vars? Is there
> some security setting I don't know about?
>
>
> Is there any code before the print_r() call, i.e. code that might be
> setting it to an empty array?
>
> If not, then are you sure your form is definitely sending post
> variables? It sounds a stupid question, but a small typo could be
> sending the data as GET by accident. Firefox has a useful extension
> called Firebug which might be able to show you the data being sent to
> the browser. If you really need to bring out the big guns, then
> Wireshark will show all the network traffic, including that sent from
> your form to the server.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
Check php.ini for this setting:
variables_order


--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com