By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,045 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

parse_str() - issue

P: n/a
Hy;

Hmm, I was experimenting with parse_str() and faked POSTs and came up
with a rather strange behaviour:

parse_str("_POST[test]=test");

puts 'test' in both _POST *and* _FILES and probably in all the others
(_REQUEST, _GET) too. Does somebody know why this occurs? Is it a bug?
(PHP Version 4.3.8)

Ciao
Niels

Jul 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rik
ni*************@seies.de wrote:
Hy;

Hmm, I was experimenting with parse_str() and faked POSTs and came up
with a rather strange behaviour:

parse_str("_POST[test]=test");

puts 'test' in both _POST *and* _FILES
Yes.
and probably in all the others
(_REQUEST, _GET) too.
No, it won't.
Does somebody know why this occurs? Is it a bug?
(PHP Version 4.3.8)
Actually, $_FILES are a subset of $_POST, it's data send to the server by a
POST method.

$_FILES is, according to the manual, "An associative array of items uploaded
to the current script via the HTTP POST method."

I doubt this is really intended behaviour, but that's the logic behind it. I
assume the normal logic to build the $_FILES & split them from the $_POST
array is not executed in parse_str().

I don't know heck about C, but to me it seems the logic of building $_FILES
is in /main/rfc1867.c of the source. There should be a guru out here who can
explain it better :-)

Grtz,
--
Rik Wasmus
Jul 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.