Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way in PHP to capture ALL the information passed using the POST method

A little while ago, I asked a question about using the same input name/hidden name multiple times in a page, and got an answer that did not work as it suggested the I had to use to put brackets after the field name, like partno[].

I cannot use this in my form, as the cart it is being sent to only recognizes certain field names like: partno, item, price, qty, etc. (I cannot use partno[], item[], etc.) So I really need to be able to get all the values for each identical field name used multiple times. When I use the method GET, it will display all the values for each field name used in the address bar. You can try this and submit the form. Look at the url in the address bar.

My new question is: Is there a way in PHP to capture all the information passed using the POST method? (like what shows up in the address bar in the example above but using POST, not GET). I can parse it if I can figure out a way to capture it.

Thanks, Kelly

like image 720
user1519293 Avatar asked Oct 07 '22 05:10

user1519293


1 Answers

You just use $_POST instead of $_GET.

So if you were using get in the following way:

?something=somevalue

And were catching it with $_GET['something'], you would now use $_POST['something'].

like image 170
Valjas Avatar answered Oct 13 '22 11:10

Valjas