⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 down.php

📁 航空订票系统基于asp.net和sql2005包含数据库和图片
💻 PHP
字号:
<?
/*
*#########################################
* PHPCMS 文件管理器 v4.01 
* Copyright (c) 2004-2006 phpcms.cn
* 作者:Longbill ( http://www.longbill.cn )
* 请保留版权信息
*#########################################
*/

include_once("func.php");
include_once("class/longbill.class.php");
$user=check_login();
$roo=$user["root"];
if (!$user)
{
	header("Content-type:TEXT/HTML;Charset=GB2312");
	die("<script language=javascript>alert('登陆超时!');parent.window.location='login.php';</script>");
}

include_once("pre_do.php");

$path = dealpath($path);

if (!$path || !$user["downfile"]) exit("<script>alert('没有权限!');</script>");

if ($action=="downfile")
{
	$ftype=getext($path);
	if ($user["limit"]["$ftype"] && !$user["only"])
		exit("<script>alert('您不能下载{$user["limittype"]}类型的源文件!');</script>");
	else if(!$user["limit"]["$ftype"] && $user["only"])
		exit("<script>alert('您不能下载除{$user["limittype"]}类型以外的源文件!');</script>");
	$path=str_replace("|","",$path);
	if (!file_exists($path)) exit("<script>alert('文件不存在!!');</script>");
	$arr=explode("/",$path);
	$filename=$arr[count($arr)-1];
	header('Content-type: application/x-'.$ftype);
	header("Content-Disposition: attachment; filename=$filename");
	header("Content-length: ".filesize($path));
	readfile($path);
	inlog("文件下载,$path");
}
else if ($action == "downfiles")
{
	$sfile=urldecode($_GET["files"]);
	$sdir=urldecode($_GET["dirs"]);
	if (!$content=zippack($path,$sdir,$sfile)) die("<script>alert('下载时出错!');</script>");
	
	$filename=substr($path,0,strlen($path)-1).".zip";
	$filename=basename1($filename);

	if ($filename=="..zip") $filename="root.zip";
	header('Content-type: application/x-zip');
	header("Content-Disposition: attachment; filename=$filename");
	header("Content-length:".strlen($content));
	echo $content;
	die;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -