-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
112 lines (109 loc) · 3.04 KB
/
index.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html>
<script>
function cek(){
//untuk mengetahui IP address
var informasi1 = '<?php
function IPnya() {
$ipaddress = '';
if (getenv('HTTP_CLIENT_IP'))
$ipaddress = getenv('HTTP_CLIENT_IP');
else if(getenv('HTTP_X_FORWARDED_FOR'))
$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
else if(getenv('HTTP_X_FORWARDED'))
$ipaddress = getenv('HTTP_X_FORWARDED');
else if(getenv('HTTP_FORWARDED_FOR'))
$ipaddress = getenv('HTTP_FORWARDED_FOR');
else if(getenv('HTTP_FORWARDED'))
$ipaddress = getenv('HTTP_FORWARDED');
else if(getenv('REMOTE_ADDR'))
$ipaddress = getenv('REMOTE_ADDR');
else
$ipaddress = 'IP Tidak Dikenali';
return $ipaddress;
}
$ipaddress=$_SERVER['REMOTE_ADDR'];
echo IPnya();
?>';
//sistem operasi yang digunakan
var informasi2 = '<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$operating_system = 'Unknown';
if (preg_match('/linux/i', $user_agent)) {
echo $operating_system = 'Linux';
}
if (preg_match('/android/i', $user_agent)) {
echo $operating_system = 'Android';
}
elseif (preg_match('/macintosh|mac os x/i', $user_agent)) {
echo $operating_system = 'Mac';
}
elseif (preg_match('/windows|win32/i', $user_agent)) {
echo $operating_system = 'Windows';
}
?>';
//browser yang digunakan
var informasi3 = '<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$browser = 'Unknown';
if(preg_match('/MSIE/i', $user_agent)) {
echo $browser = 'Internet Explorer';
}
elseif(preg_match('/Firefox/i', $user_agent)) {
echo $browser = 'Mozilla Firefox';
}
elseif(preg_match('/OPR/i', $user_agent)) {
echo $browser = 'Opera';
}
elseif(preg_match('/Chrome/i', $user_agent)) {
echo $browser = 'Google Chrome';
}
elseif(preg_match('/Safari/i', $user_agent)) {
echo $browser = 'Apple Safari';
}
elseif(preg_match('/Netscape/i', $user_agent)) {
echo $browser = 'Netscape';
}
?>';
var informasi4 = '<?php
include 'getgeo.php';
$ip=$_SERVER['REMOTE_ADDR'];
$userGeoData = getGeoIP($ip);
if ($userGeoData != null){
$userGeoData->country_code. ' ';
echo $userGeoData->country_name. ' ';
} else {
echo "Null";
}
?>';
document.data.ip.value=informasi1;
document.data.sistem_operasi.value=informasi2;
document.data.browser.value=informasi3;
document.data.negara.value=informasi4;
}
</script>
<center>
<h1>Program Menampilkan Informasi Client</h1>
<hr>
<form name="data">
<table border="0"align="center"bgcolor="lightgrey">
<tr>
<td>IP address</td><td>:</td>
<td><input type="text"name="ip"value=""readonly></td>
</tr>
<tr>
<td>Sistem Operasi </td><td>:</td>
<td><input type="text"name="sistem_operasi"value=""readonly></td>
</tr>
<tr>
<td>Browser </td><td>:</td>
<td><input type="text"name="browser"value=""readonly></td>
</tr>
<tr>
<td>Negara</td><td>:</td>
<td><input type="text"name="negara"value=""readonly></td>
</tr>
<tr>
<td colspan="3"align="right"><input type="button" name="cek_ip"value="Cek"onclick="cek()">
</table>
</form>
</html>