Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type: text/text");
- function generateRandomString($length = 10) {
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $charactersLength = strlen($characters);
- $randomString = '';
- for ($i = 0; $i < $length; $i++) {
- $randomString .= $characters[rand(0, $charactersLength - 1)];
- }
- return $randomString;
- }
- $key = "CHANGEME;
- $uploadhost = "http://changeme.changeme/img/";
- $redirect = "http://changeme(homepage).in";
- if (isset($_POST['k'])) {
- if ($_POST['k'] == $key) {
- $target = getcwd() . "/" . basename($_FILES['d']['name']);
- if (move_uploaded_file($_FILES['d']['tmp_name'], $target)) {
- $gay = generateRandomString(6);(getcwd() . "/" . basename($_FILES['d']['name']));
- rename(getcwd() . "/" . basename($_FILES['d']['name']), getcwd() . "/" . $gay . "." . end(explode(".", $_FILES["d"]["name"])));
- echo $uploadhost .$gay . "." . end(explode(".", $_FILES["d"]["name"]));
- } else {
- echo "Sorry, there was a problem uploading your file.";
- }
- } else {
- header('Location: '.$redirect);
- }
- } else {
- header('Location: '.$redirect);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement