Multi-user file free upload voting system without database (2)_PHP tutorial
WBOY
Release: 2016-07-21 16:02:53
Original
667 people have browsed it
This is the download.php of this system, which is mainly responsible for downloading and counting. The file format is explained in the comments.
// Pass in num as the file number to be downloaded, col=column to be downloaded //Add one to the number of ip downloads without timeout
//File format //0Number<1 Author <2 File location<3 Voting count<4 Introduction<5 File size<6 Number of file downloads //ip file format Address: Project: Time
$uploadto= "../uploadfile/".$col."/";//The subdirectory uploaded to $cgiroot="http://eccct.51.net/cgi-bin/"; //Host plus current Directory
$pathtemp=explode("/",$HTTP_ENV_VARS["PATH_INFO"]); $pathtemp[sizeof($pathtemp)-1]=""; $cgiroot=" http://".$HTTP_HOST.implode("/",$pathtemp);//Host plus current directory
$ipfile=$uploadto.$col.".ipd";//For downloading ip file $overtime=4;//Timeout time hours
//Take out the ip file $fp=@fopen($ipfile,"r") or die("Sorry about that The vote is illegal".$goback); $ipinfo=fread($fp,filesize($ipfile)); fclose($fp); unlink($ipfile); $times =getdate(); $abstime=$times["yday"].sprintf("%02d",$times["hours"]); //Absolute time
//Remove the timeout ip $ip_times=explode("|",$ipinfo); $temp=""; $ipinfo="";
//header("Content-Disposition: attachment; filename=".$filepath); //Header("Location: ".$filepath); //header("Content-Description: PHP3 Generated Data
?>
http://www.bkjia.com/PHPjc/316394.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/316394.htmlTechArticle这是本系统的download.php,主要负责下载和记数,其中文件格式均在注释中说明. html ?php //传入num为要下载的文件号,col=要下载的分栏 //ip不超时...
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn