【源码】程序在线安装工具 

@Ta 2013-02-06 4405点击
工具的作者是:My Root Ftp 的作者 我只是稍做了下修改+汉化 
调用的是“ZipArchive类” 已测试By空间无法使用本工具 
(文件1)url.php

下载不了点击这里
代码:
<?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>';
?>
回复列表(9|隐藏机器人聊天)
添加新回复
回复需要登录