This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
101 lines (78 loc) · 1.81 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
<?php
require_once ("session.php");
// 1. Check if we have a banned IP accessing the page
$bool = "false";
$banned_ip = CheckBannedIP($_SERVER['REMOTE_ADDR']);
if ($banned_ip == 1)
{
ShowBlankPage();
exit;
}
if (ExistsInRBL())
{
ShowBlankPage();
exit;
}
// 2. Set the REQUEST_URI to readable format
$id = $_SERVER['REQUEST_URI'];
$id = trim(SanitiseURI($id));
if ($id == "")
{
ShowMainPage();
exit;
}
// 3. Do a select from the database where the $id is the request_uri
DBConnect();
$check_id = mysql_query("SELECT user_name, ncane_url, ncane_hit, ncane_adult FROM ncane_tbl WHERE ncane_id = '" .
$id . "' AND ncane_exp = 0") or die(mysql_error());
while ($row = mysql_fetch_assoc($check_id))
{
$ncaneuser = $row['user_name'];
$result = trim($row['ncane_url']);
$hitcount = $row['ncane_hit'];
$adult = $row['ncane_adult'];
}
//DBCloseConnection();
$hitcounter = intval($hitcount);
$countermax = intval("24");
if($ncaneuser != 'free_user') $countermax = intval("1000000");
if ($hitcounter > $countermax)
{
$bool = "true";
}
else
{
$bool = "false";
}
// 4. Redirect to main page if no URL is set
if ($result == "")
{
ShowMainPage();
exit;
}
// 5. Increase hit counter for URL
IncreaseHitCounter($id);
// 6. Redirect to Adult commentary if adult flag is set
if ($adult == "1")
{
ShowAdultContent($result);
exit;
}
// 7. If URL ends with image extension, redirect to the URL directly
CheckImageExtension($id, $result);
// 8. If hit counter is under 25, redirect to the URL directly
if ($bool == "true")
{
ShowFreeLinkNotice($result, $hitcounter);
exit;
}
// 9. If URL ends in .EXE, redirect to executable file commentary
$newlen = strlen($result) - 4;
if (substr($result, $newlen, 4) == ".exe") {
ShowExecutable($result);
}
// 10. Finally, redirect to the URL
ShowNcaneURL($result);
exit;
// ---- List of functions:
?>