-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredirect.php
More file actions
75 lines (54 loc) · 2.9 KB
/
Copy pathredirect.php
File metadata and controls
75 lines (54 loc) · 2.9 KB
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
<?php
require "production.php"; // Refer to production.template for information on setting this file up.
require "php/backend.php";
require "php/URL.php";
global $dbc;
global $config;
$backend = new Backend($config, $dbc);
$URL = new URL($backend);
// Handle error
if(!isset($_GET["id"])){
header("Location: index.php");
return;
}
$resp = $URL->find($_GET["id"]);
if($resp["data"]["has-snap"] == 0){
header("Location: ".$resp["data"]["long"]);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>v0.lt</title>
<meta name="description" content="v0.lt super charges your URLs.">
<!-- Materialize resources -->
<link rel="stylesheet" href="css/materialize.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/materialize.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- app resources -->
<link rel="stylesheet" href="css/v0.lt.css">
<script src="js/v0.lt.js"></script>
</head>
<body class="container">
<h3><i class="material-icons left" style="font-size: 48px;">flash_on</i> v0.lt</h3>
<div class="inputbox z-depth-2">
<h5><i class="material-icons left" style="font-size: 24px;">exit_to_app</i> REDIRECT</h5>
<?php if($resp["error"] == null): ?>
<p>You are being sent to <code><?= $resp["data"]["long"]; ?></code>. Choose what you want to do below.</p><br />
<a href="<?= $resp["data"]["long"]; ?>" class="btn-flat waves-effect waves-light white-text" style="width: 100%;"><i class="material-icons left">arrow_forward</i> Continue</a><br />
<p>Continues to the original link used when creating this short link.</p><br />
<a href="snapshot.php?id=<?= $_GET["id"]; ?>" class="btn-flat waves-effect waves-light white-text" style="width: 100%;"><i class="material-icons left">pageview</i> View snapshot</a>
<p>Views the snapshot we created when this short link was created, preserving the state of the page from time changes.</p>
<?php else: ?>
<p>An error occurred while handling this short link redirection.<br />Code — <code><?= $resp["error"]["code"]; ?></code><br />Message — <code><?= $resp["error"]["message"]; ?></code></p><br />
<a href="index.php" class="btn-flat waves-effect waves-light white-text" style="width: 100%;"><i class="material-icons left">home</i> Go back to home</a>
<?php endif; ?>
</div>
<br />
<div class="center-align">
<a href="https://github.com/v0lture/v0.lt" class="btn-flat waves-effect waves-light">Source</a>
<a href="https://v0lture.com/contact.php" class="btn-flat waves-effect waves-light">Contact</a>
</div>
</body>
</html>