Home > php教程 > php手册 > body text

不用数据库的多用户文件自由上传投票系统(1)

WBOY
Release: 2016-06-13 12:38:28
Original
745 people have browsed it

这是我近来开发的一套上传投票一体化的系统,共由4个php和若干记录文件组成,这是第一个view.php,主要负责显示文件列表和上传的文件表单和文件名的检验.其中的地址均为真实地址,请使用时作相应修改,我将在最后1篇提供具体的使用方法。
















//col为栏目,当存在$uploadto/$col.if(纪录title),$col.ip,$col.ipd,$col.lst时合法
//
//page为第几页1-n
//rowperpage为每页几行


if(!$page) $page=0;

$rowperpage=5;
if(!$col) die("系统出错");

$cgiroot="http://eccct.51.net/cgi-bin/";//此php所在位置
$uploadto="../uploadfile/".$col."/";



$fp=@fopen($uploadto.$col.".if","r") or die("系统出错");

$title=fread($fp,filesize($uploadto.$col.".if"));

fclose($fp);//$title为本上传的名称


$recfile=$uploadto.$col.".lst";
$fp=@fopen($recfile,"r") or die("系统出错");

$info=explode(">",fread($fp,filesize($recfile)));
fclose($fp);

$maxpage=ceil((sizeof($info)-1)/$rowperpage);
if(!$maxpage) $maxpage=1;

if($page>$maxpage||$page
echo "";
echo "";

echo "";
echo "";
echo "";
echo "


".$title."

共".(sizeof($info)-1)."个作品第".$page."/".$maxpage."页";
if($page+1echo "下一页";

echo "
";
if($page-1>0)
echo "上一页";
echo "


";
$startrec=($page-1)*$rowperpage;
$endrec=$startrec+$rowperpage;

for($i=$startrec;$i
    $items=explode("         if(!trim($items[0])) continue;

    echo "";
    echo "";

    echo "";
    if(!trim($items[1]))$items[1]="打死我也不说";
    echo "";
$temp=sprintf("%d",trim($items[5])/1024);
echo "";
    echo "";

     
echo "";
echo "";

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


$ev="";
echo $ev;



    echo "";



        if(!trim($items[4]))$items[4]="保密";
    echo "";
    echo "
编号".$items[0]."作者".$items[1]."文件名".trim($items[2])."(".$temp."KB)
得票数".$items[3]."下载次数".$items[6]."我要投票
简介".$items[4]."


";

}

?>









我要投稿


  作者:
简介:

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







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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!