forked from interclip/interclip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr.php
41 lines (35 loc) · 931 Bytes
/
r.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
<title>Check this clip out!</title>
<?php
include("includes/db.php");
function reDir($url)
{
header("Location: " . $url . "");
die();
}
if (isset($_GET['c'])) {
$user_code = $_GET['c'];
$conn = new mysqli($servername, $username, $password, $DBName);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sqlquery = "SELECT * FROM userurl WHERE usr = '$user_code'";
$result = $conn->query($sqlquery);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$url = $row['url'];
echo "Redirecting you to " . $url;
reDir($url);
break;
}
$conn->query($sqlquery);
} else {
echo "URL not found";
}
$conn->close();
} elseif (isset($_GET['f'])) {
$url = $_GET['f'];
include("includes/proxy.php");
} else {
reDir("./");
}