index.php
991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//下載附件
function DoDownFile($fileid){
global $empire,$public_r,$class_r,$dbtbpre;
if(empty($fileid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$r=$empire->fetch1("select fileid,path,filename,classid,fpath from {$dbtbpre}enewsfile_1 where fileid='$fileid'");
if(empty($r[fileid]))
{
printerror("ErrorUrl","history.go(-1)",1);
}
//下載數加1
$sql=$empire->query("update {$dbtbpre}enewsfile_1 set onclick=onclick+1 where fileid='$fileid'");
$ok=1;
//按欄目
$fspath=ReturnFileSavePath($r[classid],$r[fpath]);
$filepath=$r[path]?$r[path].'/':$r[path];
$downurl=$fspath['fileurl'].$filepath.$r[filename];
if($ok)
{
Header("Location:$downurl");
}
}
//下載附件
$fileid=(int)$_GET['fileid'];
DoDownFile($fileid);
db_close();
$empire=null;
?>