This question already has an answer here:
- Print out post values 10 answers
I need to see all of the POST
results that are submitted to the server for testing.
What would be an example of how I can create a new file to submit to that will echo out all of the fields which were submitted with that form?
It's dynamic, so some fields may have a name/ID of field1, field2, field3
, etc.
All the values are stored in the
$_POST
collectionor if you want something fancier that is easier to read use a foreach loop to loop through the
$_POST
collection and print the values.Simply:
You could use something as simple as this
This would make it a bit more viewable:
Bonus: Check debug_backtrace() too add tracing to your debugging.
You may mean something like this:
You can definitely use
var_dump
, but you mentioned you are in front-end development. I am sure you would know this, but just as a reminder, use Firefox's Firebug or Chrome's / Internet Explorer's developers tool and check for the post. Post goes through hearders, and you should be able to check it from there too.