已掉线,重新登录

首页 > 绿虎论坛 > 杂类 > 超级灌水 (发帖)

标题: php的远程上传谁有

作者: @Ta

时间: 2013-04-27

点击: 863

给个php的远程上传文件,研究研究

[隐藏样式|查看源码]


『回复列表(6|显示机器人聊天)』

1. 原理:
<?php
$url=$_GET['url'];
$name=end(explode('/',$url));
$txt=file_get_contents($url);
file_put_contents($name,$txt);
?>
 
(/@Ta/2013-04-27 18:18//)

2. 搜索cai.php
(/@Ta/2013-04-27 18:30//)

3. @扯淡的青春
(/@Ta/2013-04-27 19:17//)

4. 我怎么上传不了附件?
(/@Ta/2013-04-27 19:18//)

5. url.php  远程上传加解压  不留压缩包在空间   具体看我帖
(/@Ta/2013-04-27 20:02//)

6. <?php
/*
* Package: FTP Installer
* Author: Achunk JealousMan
* Email: achunk17@gmail.com
* Site: http://7ko.in
*/
error_reporting(0);
ignore_user_abort(true);
if(!class_exists('ZipArchive')) {
die("调用ZipArchive类失败!");
}
function zipExtract ($src, $dest)
    {
        $zip = new ZipArchive();
        if ($zip->open($src)===true)
        {
            $zip->extractTo($dest);
            $zip->close();
            return true;
        }
        return false;
    }

echo '<html><head><title>远程在线安装</title></head><body>';
if (!isset($_GET['zip'])) {
echo '<form method="get" action="?"><b>文件地址:</b><br /><input type="text" name="zip" value="http://"/><input type="submit" value="Install"/></form></body></html>';
exit;
}
$RemoteFile = rawurldecode($_GET["zip"]);
$ZipFile = "Archive.zip";
$Dir = "./";

copy($RemoteFile,$ZipFile) or die("无法复制文件 <b>".$RemoteFile);

if (zipExtract($ZipFile,$Dir)) {
echo "<b>".basename($RemoteFile)."</b> 成功解压文件到当前目录.";
unlink($ZipFile);

}
else {
echo "无法解压该文件 <b>".$ZipFile.".</b>";
if (file_exists($ZipFile)) {
unlink($ZipFile);
}

}
echo '</body></html>';
?>
(/@Ta/2013-04-27 20:07//)

回复需要登录

7月27日 21:31 星期天

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1