<html>
<head>
<title>HTTP related PHP variables</title>
</head>
<body bgcolor=lightyellow>
<h1 align=center>HTTP related PHP variables</h1>
<br><br>
<form method=post action=<?php echo $_SERVER['PHP_SELF'] ?> >
<input type=hidden name=hiddenField value=secret>
<input type=submit value="HTTP Vars">
</form>
<?php include "../include.php"; ?> <!-- hyperlink to see the code -->
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); //all errors except notices and warnings
print "<b>The _GET Variables</b><br>";
foreach($_GET as $name => $value)
print "<br><b> $name = </b> $value ";
print "<br><br><hr>";
print "<b>The _POST Variables</b><br>";
foreach($_POST as $name => $value)
print "<br><b> $name = </b> $value ";
print "<br><br><hr>";
print "<b>The _COOKIE Variables</b><br>";
foreach($_COOKIE as $name => $value)
print "<br><b> $name = </b> $value ";
print "<br><br><hr>";
print "<b>The _REQUEST Variables</b><br>";
foreach($_REQUEST as $name => $value)
print "<br><b> $name = </b> $value ";
print "<br><br><hr>";
print "<b>The Request Headers</b><br>";
print "<br><b>HTTP_ACCEPT: </b> $_SERVER[HTTP_ACCEPT]";
print "<br><b>HTTP_ACCET_ENCODING: </b> $_SERVER[HTTP_ACCEPT_ENCODING]";
print "<br><b>HTTP_ACCEPT_LANGUAGE:</b> $_SERVER[HTTP_ACCEPT_LANGUAGE]";
print "<br><b>HTTP_CONNECTION: </b> $_SERVER[HTTP_CONNECTION]";
print "<br><b>HTTP_COOKIE: </b> $_SERVER[HTTP_COOKIE]";
print "<br><b>HTTP_HOST: </b> $_SERVER[HTTP_HOST]";
print "<br><b>HTTP_REFERER: </b> $_SERVER[HTTP_REFERER]";
print "<br><b>HTTP_USER_AGENT: </b> $_SERVER[HTTP_USER_AGENT]";
print "<br><br><hr>";
print "<b>The Response Headers</b><br>";
$headers = headers_list();
foreach($headers as $header)
print "<br> $header ";
print "<br><br><hr>";
print "<b>The _SERVER Variables</b><br>";
foreach($_SERVER as $name => $value)
print "<br><b> $name = </b> $value ";
print "<br><br><hr>";
?>
</body>
</html>