Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 24 lines (23 sloc) 0.696 kB
7eb0941 @deepwinter initial
authored
1 <?php
200052d @deepwinter Updated to print all of the PHP auto variables recursively
authored
2 function foreachPrint($fh, $myArray){
3 foreach($myArray as $h=>$v){
4 fwrite($fh, "$h = $v\n");
5 if(is_array($v)){
6 foreachPrint($fh, $v);
7 }
8 }
9 }
7eb0941 @deepwinter initial
authored
10 $myFile = "requestslog.txt";
11 $fh = fopen($myFile, 'a') or die("can't open file");
12 fwrite($fh, "\n\n---------------------------------------------------------------\n");
13 foreach($_SERVER as $h=>$v)
14 fwrite($fh, "$h = $v\n");
200052d @deepwinter Updated to print all of the PHP auto variables recursively
authored
15 fwrite($fh, "REQUEST\n");
16 foreachPrint($fh, $_REQUEST);
17 fwrite($fh, "FILES\n");
18 foreachPrint($fh, $_FILES);
7eb0941 @deepwinter initial
authored
19 fwrite($fh, "\r\n");
20 fwrite($fh, file_get_contents('php://input'));
21 fclose($fh);
22 echo "<html><head /><body><iframe src=\"$myFile\" style=\"height:100%; width:100%;\"></iframe></body></html>"
23 ?>
Something went wrong with that request. Please try again.