How to print all information from an HTTP request to the screen, in PHP
I need some PHP code that does a dump of all the information in an HTTP request, including headers and the contents of any information included in a POST request. Basically, a diagnostic tool that spits out exactly what I send to a server.
Does anyone have some code that does this?
Solution 1:
Lastly:
print_r($_REQUEST);
That covers most incoming items: PHP.net Manual: $_REQUEST
Solution 2:
A simple way would be:
<?php
print_r($_SERVER);
print_r($_POST);
print_r($_GET);
print_r($_FILES);
?>
A bit of massaging would be required to get everything in the order you want, and to exclude the variables you are not interested in, but should give you a start.