Home > Backend Development > PHP Tutorial > Free multi-user file upload voting system without database 1

Free multi-user file upload voting system without database 1

WBOY
Release: 2016-07-29 08:34:31
Original
985 people have browsed it

This is an integrated uploading and voting system that I recently developed. It consists of 4 php and several record files. This is the first view.php, which is mainly responsible for displaying the file list, uploaded file form and file name verification. .The addresses in it are all real addresses. Please modify them accordingly when using them. I will provide specific usage methods in the last article.







<script> <br>function opennewwin(url){ <br>window.open(url,null, "height=200,width=200,status=no,toolbar=no,menubar=no,location=no"); <br>} <br>function check(theform){ <br>var tempstr=theform.upfile.value.split("" ); <br>var files=tempstr[tempstr.length-1].split("."); <br>if(theform.writer.value=="" || theform.upfile.value=="" ){alert(" The author and file name cannot be empty"); event.returnValue= false; } <br>if(escape(tempstr[tempstr.length-1]).indexOf("%u")!=-1){ <br>alert("File The name cannot be Chinese"); <br>event.returnValue= false; <br>} <br>if(files.length<2 || (files[1]!="rar" && files[1]!="zip")){ <br> alert("The file name must end with lowercase zip or rar"); <br>event.returnValue= false; <br>} <br>}<br></script>


//col is the column, when there is $uploadto/$col.if (record title), $col.ip, $col .ipd, legal when $col.lst
//
//page is the number of pages 1-n
//rowperpage is the number of rows per page
if(!$page) $page=0;
$rowperpage=5;
if(!$col) die("System error");
$cgiroot="http://eccct.51.net/cgi-bin/";//The location of this php
$uploadto="../ uploadfile/".$col."/";
$fp=@fopen($uploadto.$col.".if","r") or die("System error");
$title=fread($fp ,filesize($uploadto.$col.".if"));
fclose($fp);//$title is the name of this upload
$recfile=$uploadto.$col.".lst";
$fp =@fopen($recfile,"r") or die("System error");
$info=explode(">",fread($fp,filesize($recfile)));
fclose($fp) ;
$maxpage=ceil((sizeof($info)-1)/$rowperpage);
if(!$maxpage) $maxpage=1;
if($page>$maxpage||$page<1)$page =1;
echo "";
echo "";
echo " ";
echo "";
echo "";
echo "


".$ title."

total".(sizeof ($info)-1)."ArticlesPage ".$page."/".$maxpage."";
if($page+1<=$maxpage)
echo "Next page";
echo "
";
if ($page-1>0)
echo "Previous page";
echo "


";
$startrec=($page-1)*$rowperpage ;
$endrec=$startrec+$rowperpage;
for($i=$startrec;$i<$endrec&&$info[$i]!="";$i++){
$items=explode("<", $info[$i]);
if(!trim($items[0])) continue;
echo "";
echo "< td width=16.5% class=items>number";
echo "";
if( !trim($items[1]))$items[1]="I won’t tell you even if you kill me";
echo "";
$temp=sprintf("%d",trim($items[5])/1024);
echo "< td width=16.5% class=items>File name" " ";
echo " ";
$click="opennewwin("download.php?num=".$items[0]."&col=".$col."");return false;";
$ev="";
  if(!trim($items[4]))$ items[4]="Confidential";
echo "";
echo "
".$items[0]."Author".$items[1]."".trim($items[2])."(".$temp."KB)Number of downloads".$items[6]."I want to vote
Introduction".$items[4]."< /td>


";
}
?>






< ;center>

I want to contribute


Author:
Introduction:

File:(Please do not include Chinese in the file name, the file is less than 1MB, and ends with zip, rar)


< /form>



The above has introduced the multi-user file free upload voting system without a database 1, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template