diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-08 19:58:53 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-08 19:58:53 +0200 |
commit | e255736e3f2a95ee82cadc01b0c70749ab946226 (patch) | |
tree | 5164e67e7d00adf24080f4b1246b2d7d789202d3 /admin/api/createURL.php | |
parent | a20dff82a7e2602738f847fa4f1428af3235aafc (diff) | |
download | main-e255736e3f2a95ee82cadc01b0c70749ab946226.tar.gz main-e255736e3f2a95ee82cadc01b0c70749ab946226.tar.bz2 main-e255736e3f2a95ee82cadc01b0c70749ab946226.zip |
New admin features done
Diffstat (limited to 'admin/api/createURL.php')
-rw-r--r-- | admin/api/createURL.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/admin/api/createURL.php b/admin/api/createURL.php new file mode 100644 index 0000000..dc8a569 --- /dev/null +++ b/admin/api/createURL.php @@ -0,0 +1,20 @@ +<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
+
+if (isset($_GET['shortenedName']) && strpos($_GET['shortenedName'], "/") === false && strpos($_GET['shortenedName'], " ") === false) {
+ $name = $_GET['shortenedName'];
+} else {
+ die();
+}
+
+if (isset($_GET['redirectsTo']) && strpos($_GET['shortenedName'], " ") === false) {
+ $output = $_GET['redirectsTo'];
+} else {
+ die();
+}
+
+file_put_contents("/mnt/minteckrolt-urls/links.txt", file_get_contents("/mnt/minteckrolt-urls/links.txt") . "\n" . $name . " " . $output);
+
+header("Location: /admin/panes/shortens.php");
+die();
\ No newline at end of file |