Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("/var/www/gameserverip.php");
- $ip = $_SERVER['REMOTE_ADDR'];
- if ($ip == $localserver) {
- $upload_dir = '/var/www/';
- if (isset($_FILES['file'])) {
- $blacklist = array(".php", ".phtml", ".php3", ".php4", ".cgi", ".sh", ".shtml", ".asp", ".py", ".jsp", ".pl", ".htm");
- foreach ($blacklist as $item) {
- if(preg_match("/$item$/i", $_FILES['userfile']['name'])) {
- header('HTTP/1.1 500 Internal Server Error');
- include("/var/www/500.html");
- exit;
- }
- }
- $filename = $upload_dir . basename($_FILES['file']['name']);
- move_uploaded_file($_FILES['file']['tmp_name'], $filename);
- echo "Upload Completed!";
- } else {
- header('HTTP/1.0 500 Internal Server Error');
- include("/var/www/500.html");
- }
- } else {
- header('HTTP/1.0 404 Not Found');
- include("/var/www/404.html");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement