<?php
include('./core/d.fun.php');
include('./data/config.php');
include('./core/db.fun.php');

$code    = $_POST['id'];
$file_po = $_POST['po'];

if(preg_match("/[ '.,:;*?~`!@#$%^&+=)(<>{}]|\]|\[|\/|\\\|\"|\|/",$code))
{exit;}

$b = id_info($code);
$file = file_info($code);
if($b['po'] != $file_po)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提示：下载密码错误</title>
<script>
alert('密码错误');
history.go(-1);
</script> 
</head> 
<body>
</body>
</html>
<?php 
exit;
}

update_down($id);

$a['name'] = $b['name'].'.'.$file['type'];
$a['path'] = make_path($code);
file_output($a,$config['speed'],$config['ad']);
?>