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/deleteURL.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/deleteURL.php')
-rw-r--r-- | admin/api/deleteURL.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/admin/api/deleteURL.php b/admin/api/deleteURL.php new file mode 100644 index 0000000..895751e --- /dev/null +++ b/admin/api/deleteURL.php @@ -0,0 +1,23 @@ +<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
+
+if (isset($_GET['_']) && strpos($_GET['_'], "/") === false) {
+ $arg = $_GET['_'];
+} else {
+ die();
+}
+
+$urls = explode("\n", file_get_contents("/mnt/minteckrolt-urls/links.txt"));
+$newUrlsArr = [];
+
+foreach ($urls as $url) {
+ if (explode(" ", $url)[0] !== $arg) {
+ $newUrlsArr[] = $url;
+ }
+}
+
+file_put_contents("/mnt/minteckrolt-urls/links.txt", implode("\n", $newUrlsArr));
+
+header("Location: /admin/panes/shortens.php");
+die();
\ No newline at end of file |