-
Notifications
You must be signed in to change notification settings - Fork 1
/
bugslogger.php
78 lines (71 loc) · 2.58 KB
/
bugslogger.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
$referer = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'Unspecified';
$useragent = getenv('HTTP_USER_AGENT');
if (strstr($useragent, 'Win'))
$os = 'Windows';
else if ((strstr($useragent, 'Mac')) || (strstr($useragent, 'PPC')))
$os = 'Mac';
else if (strstr($useragent, 'Linux'))
$os = 'Linux';
else if (strstr($useragent, 'FreeBSD'))
$os = 'FreeBSD';
else if (strstr($useragent, 'SunOS'))
$os = 'SunOS';
else if (strstr($useragent, 'IRIX'))
$os = 'IRIX';
else if (strstr($useragent, 'BeOS'))
$os = 'BeOS';
else if (strstr($useragent, 'OS/2'))
$os = 'OS/2';
else if (strstr($useragent, 'AIX'))
$os = 'AIX';
else
$os = 'Unknown';
$fp = fopen('logs.txt', 'a');
fwrite($fp, '+-[' . date('l jS \of F Y h:i:s A') . ']');
fwrite($fp, "\r\n");
fwrite($fp, '|');
fwrite($fp, "\r\n");
fwrite($fp, '|IP.................: ' . htmlentities($_SERVER['REMOTE_ADDR']));
fwrite($fp, "\r\n");
fwrite($fp, '|User-Agent.........: ' . $useragent);
fwrite($fp, "\r\n");
fwrite($fp, '|OS.................: ' . $os);
fwrite($fp, "\r\n");
fwrite($fp, '|URi.Bugged.........: ' . htmlentities($_SERVER['REQUEST_URI']));
fwrite($fp, "\r\n");
fwrite($fp, '|Variable.Bugged....: ' . htmlentities($_SERVER['QUERY_STRING']));
fwrite($fp, "\r\n");
fwrite($fp, '|Accept-Language....: ' . htmlentities($_SERVER['HTTP_ACCEPT_LANGUAGE']));
fwrite($fp, "\r\n");
fwrite($fp, '|Port...............: ' . htmlentities($_SERVER['REMOTE_PORT']));
fwrite($fp, "\r\n");
fwrite($fp, '|Referer............: ' . htmlspecialchars($referer));
fwrite($fp, "\r\n");
fwrite($fp, '+----------------------------------------------------------------------------------');
fwrite($fp, "\r\n");
fclose($fp);
$Redirect = 3;
echo <<< EOT
<script src="js/jquery.js"></script>
<script language="javascript">
var max_time = 5;
var cinterval;
function countdown_timer(){
// decrease timer
max_time--;
document.getElementById('countdown').innerHTML = max_time;
if(max_time == 0){
clearInterval(cinterval);
window.location.assign("index.php")
}
}
// 1,000 means 1 second.
cinterval = setInterval('countdown_timer()', 1000);
</script>
EOT;
echo ('<p>Terdapat kendala, Anda akan dialihkan ke halaman utama.</p>');
echo ('<p>Kami sudah mencatat IP Anda dan data keterangan di momen Anda mengalami kendala agar dapat mengetahui titik masalahnya.<br />');
echo ('Anda akan otomatis dialihkan ke halaman utama dalam <span id="countdown">5</span> detik.<br />');
echo ('<center>Jika tidak, klik <a href="index.php">di sini</a></p></center><br>');
?>