Place the following in a file named variables.inc in the current directory.
<?php
// Print Environment Variables
echo "<b>Environment Variables from $HTTP_ENV_VARS</b><br><br>";
reset($HTTP_ENV_VARS);
while (list ($key, $val) = each ($HTTP_ENV_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print GET Variables
echo "<br>";
echo "<b>GET Variables from $HTTP_GET_VARS</b><br><br>";
reset($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print POST Variables
echo "<br>";
echo "<b>POST Variables from $HTTP_POST_VARS</b><br><br>";
reset($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print COOKIE Variables
echo "<br>";
echo "<b>COOKIE Variables from $HTTP_COOKIE_VARS</b><br><br>";
reset($HTTP_COOKIE_VARS);
while (list ($key, $val) = each ($HTTP_COOKIE_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print SESSION Variables
echo "<br>";
echo "<b>SESSION Variables from $HTTP_SESSION_VARS</b><br><br>";
reset($HTTP_SESSION_VARS);
while (list ($key, $val) = each ($HTTP_SESSION_VARS)) {
print $key . " = " . $val . "<br>";
}
?>
Call the file with the following at any point in your page where you would like the variables output.
<?php
require("variables.inc");
?>