Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("index.html");
- if(!empty($_POST)) {
- if(isset($_FILES["world"])) {
- $world = $_FILES["world"];
- $name = $world["name"];
- $tmp_name = $world["tmp_name"];
- $size = $world["size"];
- $ext = explode('.', $name);
- $ext = strtolower(end($ext));
- $allowed = "deep";
- if ($ext == $allowed) {
- if ($size <= 300000) {
- $id = uniqid('', true);
- $destination = 'worlds/' . $id . '.' . $ext;
- if(move_uploaded_file($tmp_name, $destination)) {
- echo '<br/>World: "' . $name . '" uploaded to DeeperNet!';
- echo “<br/>World ID: ” . $id;
- $info = fopen('worlds/' . $id . '.txt', 'w');
- fwrite($info, $_POST['name'] . "\r\n");
- fwrite($info, $_POST['desc']);
- fclose($info);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement