Home > php教程 > php手册 > php给rar文件添加解压说明实现代码

php给rar文件添加解压说明实现代码

WBOY
Release: 2016-06-13 11:24:53
Original
729 people have browsed it

下面的代码就是我通过我的数据库教程读取出文件路径并最终实现批量修改rar文件注释的方法.因为数据库是access,我新建了一个odbc源.同时rar.exe及cmd.exe都在1.php教程同目录下

 


$id=$_get[id];
if($id=="")
{
echo "参数错误";
exit;
}
if($id>=400)
{
echo "全部结束";
exit;
}
$db=odbc_connect("dw","","");
$sql="select * from 'download' where 'id'=$id";
$query=odbc_exec($db,$sql);
$filename=odbc_result($query,2);
if($filename=="")
{

}
$filename=str_replace("#1′,"",$filename);
$filename=str_replace("#2′,"",$filename);
$filename="soft/".$filename;
echo $filename."
";
if(!file_exists($filename))
{
echo "文件不存在,转到下一个id";
$id++;
echo "

content='0;url=../test/1.php?id=$id'>";
exit;
}//读出文件名,并检查文件是否存在
else
{
'winrar a $filename 使用说明.txt';
echo "插入说明文件成功";
$id++;
echo "";
}
odbc_close($db);
?>


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template