-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLog_ALL.php
55 lines (48 loc) · 1.24 KB
/
Log_ALL.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
if (!function_exists('getallheaders')) {
/*** This function looks like 'getallheaders()' ***/
function getallheaders() {
if (!is_array($_SERVER)) {
return array();
}
$headers = array();
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}
/*** Logged ALL of request header ***/
function rawgetallheaders() {
if (!is_array($_SERVER)) {
return array();
}
$headers = array();
foreach ($_SERVER as $name => $value) {
$headers[$name] = $value;
}
return $headers;
}
/*** Logged GET, POST, COOKIE Etc ***/
function getallrequests() {
if (!is_array($_REQUEST)) {
return array();
}
$requests = array();
foreach ($_REQUEST as $name => $value) {
$requests[$name] = $value;
}
return $requests;
}
/* Logging BEGIN */
$f = fopen('Log.txt','w+');
// print_r(getallheaders());
// print_r(getallrequests());
// fwrite($f, print_r(getallheaders(),TRUE)."\n");
// fwrite($f, print_r(getallrequests(),TRUE)."\n\n");
fclose($f);
/* Logging END */
?>
<h2>Test Zone</h2>