-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
62 lines (50 loc) · 1.85 KB
/
index.php
File metadata and controls
62 lines (50 loc) · 1.85 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
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>Sadcat's URL Shortener</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="">
<meta property="og:type" content="">
<meta property="og:url" content="">
<meta property="og:image" content="">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="manifest" href="site.webmanifest">
<meta name="theme-color" content="#fafafa">
</head>
<body>
<div class="wrapper">
<header>
<a href="index.php">Sadcat's URL Shortener</a>
</header>
<form action="/app/shorten.php">
<div class="form-container">
<input class="inputclass" name="url" id="url" type="text" placeholder="Enter your url" required>
</div>
<input type="hidden" name="action" value="create">
<input class="inputsubmit" type="submit" value="Shorten">
<div class="result-container">
<?php
if (isset($_GET['short_url'])) {
echo '<input class="inputclass" type="text" value="' . $_GET['short_url'] . '" id="short-url" readonly> <label class="copyicon" onclick="copy();">📋</label>';
}
?>
</div>
</form>
<div class="result-container">
<?php
if (isset($_GET['error'])) {
if ($_GET['error'] == "invalid_url") {
echo '<p class="error">Invalid URL</p>';
}
}
?>
</div>
</div>
<script src="js/vendor/modernizr-3.12.0.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>