Home > Backend Development > PHP Tutorial > Multi-user file free upload voting system without database (1)_PHP tutorial

Multi-user file free upload voting system without database (1)_PHP tutorial

WBOY
Release: 2016-07-21 16:02:32
Original
1099 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.





< /head>







//col is the column, when it exists $uploadto/$col.if (record title), $col.ip, $col.ipd, $col.lst are legal
//
//What page is the page 1-n
/ /rowperpage is the number of lines 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 "


" .$title."

Total ".(sizeof($info)-1)."ArticlesArticle".$page."/".$ maxpage."page";
if($page+1<=$maxpage)
echo "Next page";

echo "";
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 "";

echo "";
if(!trim($items[1]))$items[1]="I won’t even tell you if you kill me";
echo "";
$temp=sprintf("%d ",trim($items[5])/1024);
echo "";
echo "";


echo "< ;td class=items>Number of votes";
echo "";

$click="opennewwin("download.php ?num=".$items[0]."&col=".$col."");return false;";


$ev="";
echo $ev;



echo "< ;td class=values>I want to vote";



if(!trim($items[4]))$items[4]="Confidential";
echo "Introduction";
    echo "
number".$items[0 ]."Author".$items[1]."File name".trim($items [2])."(".$temp."KB)
".$items[3]."Download Times".$items[6]."< input type='button' value=Download onclick='".$click."'>".$items[4]."


";

}

?>









我要投稿


  作者:
简介:

文件:(文件名请不要包含中文,文件小于1MB,以zip,rar结尾)
  







www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316477.htmlTechArticle这是我近来开发的一套上传投票一体化的系统,共由4个php和若干记录文件组成,这是第一个view.php,主要负责显示文件列表和上传的文件表单和...
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