Skip to content

Instantly share code, notes, and snippets.

@Frankity
Created October 19, 2015 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frankity/5ac9c583091480d6ca18 to your computer and use it in GitHub Desktop.
Save Frankity/5ac9c583091480d6ca18 to your computer and use it in GitHub Desktop.
<?php
header("Content-Type: text/text");
$key = "FUCKYOU";
$uploadhost = "http://yolarrydabomb.net/i/";
$redirect = "http://yolarrydabomb.net/i/pizza.html";
date_default_timezone_set('EST');
$Date = date("Ymd-");
$filenamelength = 4;
if ($_SERVER["REQUEST_URI"] == "/robot.txt") { die("User-agent: *\nDisallow: /"); }
if (isset($_POST['key'])) {
if ($_POST['key'] == $key) {
$target = getcwd() . "/" . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) {
$md5 = md5_file(getcwd() . "/" . basename($_FILES['file']['name']));
rename(getcwd() . "/" . basename($_FILES['file']['name']), getcwd() . "/" . $Date . $md5 . "." . end(explode(".", $_FILES["file"]["name"])));
echo $uploadhost . $Date . $md5 . "." . end(explode(".", $_FILES["file"]["name"]));
} else {
echo "Sorry, there was a problem uploading your file.";
}
} else {
header('Location: '.$redirect);
}
} else {
header('Location: '.$redirect);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment