· 7 years ago · Feb 08, 2018, 11:54 PM
1<?php
2
3$secret_key = "x8f7d9f6dfsd08s7d";
4$sharexdir = "";
5$domain_url = "https://lucky-patcher.de/images/";
6$lengthofstring = 10;
7
8function RandomString($length)
9{
10 $keys = array_merge(range(0, 9), range('a', 'z'));
11
12 for ($i = 0; $i < $length; $i++) {
13 $key .= $keys[mt_rand(0, count($keys) - 1)];
14 }
15 return $key;
16}
17
18if (isset($_POST['secret'])) {
19 if ($_POST['secret'] == $secret_key) {
20
21 $filename = RandomString($lengthofstring);
22 $target_file = $_FILES["sharex"]["name"];
23 $fileType = pathinfo($target_file, PATHINFO_EXTENSION);
24
25 if (move_uploaded_file($_FILES["sharex"]["tmp_name"], $sharexdir . $filename . '.' . $fileType)) {
26 echo $domain_url . $sharexdir . $filename . '.' . $fileType;
27 } else {
28 echo 'File upload failed - CHMOD/Folder doesn\'t exists?';
29 }
30 }
31
32 else {
33 echo 'Invald Secret Key';
34 }
35} else {
36 echo 'No post data recived';
37}