-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_known_list.php
44 lines (28 loc) · 1.07 KB
/
update_known_list.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
<?php
$users = $DBH->query( 'SELECT * from users' );
$lists = $DBH->query( 'SELECT * FROM hacked_list' );
$user = $DBH->prepare( 'SELECT username, ip_address, ip_password FROM users' );
$user->execute();
$list = $DBH->prepare( 'SELECT ip_username, ip_address, ip_password, active FROM hacked_list' );
$list->execute();
$yes = 'yes';
$no = 'no';
while($list = $lists->fetch()) {
$count = 0;
$users = $DBH->query( 'SELECT * from users' );
while($user = $users->fetch()) {
$ip_username = $list['ip_username'];
if ($user['username'] == $list['ip_username'] && $user['ip_password'] == $list['ip_password'] && $user['ip_address'] == $list['ip_address']) {
$count++;
}
}
if ($count == 0) {
$update_list = $DBH->prepare(" UPDATE hacked_list SET active = '$no' WHERE ip_username = '$ip_username' ");
$update_list->execute() or die();
}
else if ($count == 1) {
$update_list = $DBH->prepare(" UPDATE hacked_list SET active = '$yes' WHERE ip_username = '$ip_username' ");
$update_list->execute() or die();
}
}
?>