Free upload of voting system with multi-user files without database 1

Source: Internet
Author: User
Tags explode fread
This is my recent development of a set of upload voting system, a total of 4 PHP and a number of record files, which is the first view.php, is mainly responsible for displaying the file list and uploaded file form and filename of the test. Where the addresses are real addresses, please use the corresponding changes, I will provide specific usage methods in the last 1 articles.










Col is a column when there is $uploadto/$col. if (record title), $col. IP, $col. IPD, $col. LST Legal
//
Page is the first few pages 1-n
Rowperpage for a few lines per page
if (! $page) $page = 0;
$rowperpage = 5;
if (! $col) Die ("System error");
$cgiroot = "http://eccct.51.net/cgi-bin/";//Where PHP is located
$uploadto = ". /uploadfile/". $col." /";
$fp = @fopen ($uploadto. $col. ". If "," R ") or Die (" System error ");
$title =fread ($fp, FileSize ($uploadto. $col. If "));
Fclose ($FP);//$title The name of the 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). " of worksSection ". $page." /". $maxpage." Page";
if ($page +1<= $maxpage)
echo "Next page";
echo "
";
if ($page -1>0)
echo "Prev";
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 don't say "kill me"; echo " "; $temp =sprintf ("%d", Trim ($items [5])/1024); echo " "; echo " "; echo " "; echo " "; $click = "Opennewwin" ("download.php?num=". $items [0]. " &col= ". $col."); return false; "; $ev = " "; if (!trim ($items [4])) $items [4]= "Confidential"; echo " "; echo "
Number". $items [0]."Author ". $items [1]."Filename ". Trim ($items [2])." (". $temp." KB)
Number of votes. ". $items [3]."Number of downloads ". $items [6]."I want to vote.
Brief introduction ". $items [4]."


";
}
?>




The above describes the use of the database of multi-user files free upload voting system 1, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.