Re: To capture Http Headers

From: Date: Tue, 09 May 2006 14:58:56 +0000
Subject: Re: To capture Http Headers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-235801@lists.php.net to get a copy of this message
Kaushal Shriyan wrote:
Hi ALL I have a sample cgi-script #!/usr/bin/perl use CGI; $cgi = new CGI; for $key ( $cgi->param() ) {
       $input{$key} = $cgi->param($key);
}
check out the superglobals $_POST, $_GET and $_REQUEST: <?php var_dump($_POST, $_GET, $_REQUEST); ?>
print qq{Content-type: text/html
this header is outputted automatically.
<html><head><script type="text/javascript" src="/domain.js"></script></head><body> };
<?php echo ' <html> <head> <script type="text/javascript" src="/domain.js"></script> </head> <body>'; ?>
print qq{<script type="text/javascript">addHeader()</script>}; print qq{<table border="2" width="60%" align="center" cellspacing="1" cellpadding="2">}; print qq{<tr><th>Key</th><th>Value</th>}; foreach $key (sort (keys %ENV)) {
       print "<tr><td>$key</td>", "<td>$ENV{$key}</td>", "</tr>";
}
echo "<ul>"; ksort($_GET); foreach ($_GET as $key => $val) { echo "<li>{$key}: {$val}</li>"; } echo "</ul>";
print qq{</table>}; print qq{<script type="text/javascript">addFooter()</script>}; print qq{</body></html>}; Can any one please help me in converting this to a php script
that should be enough help for anyone who can read/write perl ;-P
Which would be of great help Thanks in Advance Kaushal


« previous php.general (#235801) next »