aboutsummaryrefslogtreecommitdiff
path: root/admin/api/createURL.php
blob: dc8a5692d79325eec522b81fae16b9a82833a21e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();