php整站打包程序

本文将介绍如何使用PHP进行整站打包和文件压缩,包括处理文件属性、读写操作以及输入输出流的关键步骤,帮助开发者实现高效的数据归档。
摘要由CSDN通过智能技术生成



asd

<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
<title>PHP整站打包程序-By DoDo</title>
</head>  
<body>  
<form name="myform" method="post" action="">

<?php   
	ini_set('memory_limit', '2048M');
	echo "选择要压缩的文件或目录:<br>";  
	$fdir = opendir('./');  
	while($file=readdir($fdir))
	{  
		if($file=='.'|| $file=='..') 
		continue;  
		echo "<input name='dfile[]' type='checkbox' value='$file' ".($file==basename(__FILE__)?"":"checked")."> ";  
	
		if(is_file($file))
		{  
			echo "<font face=\"wingdings\" size=\"5\">2</font>  $file<br>";  
		}
		else
		{  
			echo "<font face=\"wingdings\" size=\"5\">0</font> $file<br>";  
		}  
	}  
?>  

<br>
包含下列文件类型:
<input name="file_type" type="text" id="file_type" value="" size="50">  
<font color="red">
(文件类型用"|"隔开,默认空则包含任意文件,例:如果需要打包php和jpg文件,则输入"php|jpg")
</font>
<br>
压缩文件保存到目录:  
<input name="todir" type="text" id="todir" value="__dodo__" size="15">  
<font color="red">
(留空为本目录,必须有写入权限)
</font>
<br>  
压缩文件名称:  
<input name="zipname" type="text" id="zipname" value="dodo.zip" size="15">  
<font color="red">
(.zip)
</font>
<br>  
<br>
<input name="myaction" type="hidden" id="myaction" value="dozip">  
<input type='button' value='反选' οnclick='selrev();'>  
<input type="submit" name="Submit" value=" 开始压缩 ">  
<script language='javascript'>  
	function selrev() 
	{  
		with(document.myform) 
		{  
			for(i=0;i<elements.length;i++) 
			{  
				thiselm = elements[i];  
				if(thiselm.name.match(/dfile\[]/)) 
					thiselm.checked = !thiselm.checked;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值