-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.php
49 lines (36 loc) · 1.21 KB
/
link.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
<?php
error_reporting(0);
include "functions/database.php";
$data = $db->query("SELECT * FROM settings");
$info = $db->fetch_array($data);
$ads = $db->query("SELECT * FROM ads");
$ads_info = $db->fetch_array($ads);
$shr = $db->escape_value($_GET['id']);
$getLink = $db->query("SELECT URL, date, hits, id, pass FROM links WHERE BINARY link = '$shr'");
$getLink = $db->fetch_array($getLink);
$url = isset($getLink["URL"]);
$date = isset($getLink["date"]);
$hits = isset($getLink["hits"]);
$id = isset($getLink["id"]);
$pass = isset($getLink["pass"]);
$txtpass = isset($getLink["txtpass"]);
if ($url == !'') {
$upd = "UPDATE links SET hits = hits+1 WHERE id = '$id'";
$retval = $db->query($upd);
$upd01 = "UPDATE links SET last_visit = NOW() WHERE id = '$id'";
$retval01 = $db->query($upd01);
if ($pass != '') { //link has password
if ($_POST['txtpass'] != $pass) {
include "functions/password.php";
} else {
include "functions/redirect.php";
}
} else {
include "functions/redirect.php";
}
} else { // link not found
$error_msg = "Link you followed is not found";
include "functions/error.php"; //error page
}
$db->close_connection();
?>