<?php
############预置变量###########
##########引入核心文件##########
include('./core/d.fun.php');
include('./data/config.php');
include('./core/db.fun.php');
##########接受变量#############
$code    = $_GET['c'];
##########校验流程############
if(check_code($code) == false){exit;}
##########分离ID码############
$a = get_code_info($code);
$id = $a['id'];
$linktime = $a['time'];
$info = id_info($id);
$file = file_info($id);
if(!$info){die('error ID Invalid!');}
##########链接有效检查#########
$checktime = time()-$linktime; 
$stoptime  = $config['lentime'] * 60;
if($checktime > $stoptime){exit;}
##########下载记录更新#########
update_down($id);
##########输出文件缓冲#########
$a['name'] = $info['name'].'.'.$file['type'];
$a['path'] = make_path($id);
file_output($a,$config['speed'],$config['ad']);
?>