Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = $_POST["link"];
- if (empty($link)) {
- $payload->info = "Please fill in the link.";
- $payload->message = "400: Bad Request";
- $response = new Response($payload, 400, "Bad Request");
- $response->execute();
- exit();
- }
- if (filter_var($link, FILTER_VALIDATE_URL) === FALSE) {
- $payload->info = "Your link is not valid.";
- $payload->message = "400: Bad Request";
- $response = new Response($payload, 400, "Bad Request");
- $response->execute();
- exit();
- }
- $id = bin2hex(random_bytes(4));
- $database->query("INSERT INTO shortcuts VALUES ('$oauth', '$id', 0, '$link')");
- $payload->info = "Shortcut has been created!<br><br> Your link is: https://wildbuck.co/shortcuts/$id";
- $payload->id = $id;
- $payload->message = "200: OK";
- $response = new Response($payload, 200, "OK");
- $response->execute();
- exit();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement