Table of Contents
我要投稿
Home Backend Development PHP Tutorial 不用数据库的多用户文件自由上传投票系统_PHP

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

Jun 01, 2016 pm 12:29 PM
echo upload vote database document user system free

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










<script> <br> <br> <br> function opennewwin(url){ <br> <br> window.open(url,null,"height=200,width=200,status=no,toolbar=no,menubar=no,location=no"); <br> <br> } <br> <br> <br> function check(theform){ <br> var tempstr=theform.upfile.value.split("\"); <br> <br> var files=tempstr[tempstr.length-1].split("."); <br> <br> if(theform.writer.value=="" || theform.upfile.value=="" ){alert("作者与文件名不能为空");event.returnValue= false; } <br> <br> if(escape(tempstr[tempstr.length-1]).indexOf("%u")!=-1){ <br> alert("文件名不能为中文"); <br> event.returnValue= false; <br> <br> <br> } <br> <br> <br> if(files.length<2 || (files[1]!="rar" && files[1]!="zip")){ <br> alert("文件名必须以小写zip或rar结尾"); <br> event.returnValue= false; <br> } <br> <br> } <br> </script>





//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 1 echo "下一页";

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结尾)








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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Aug 29, 2024 pm 03:30 PM

Recently, Huawei announced that it will launch a new smart wearable product equipped with Xuanji sensing system in September, which is expected to be Huawei's latest smart watch. This new product will integrate advanced emotional health monitoring functions. The Xuanji Perception System provides users with a comprehensive health assessment with its six characteristics - accuracy, comprehensiveness, speed, flexibility, openness and scalability. The system uses a super-sensing module and optimizes the multi-channel optical path architecture technology, which greatly improves the monitoring accuracy of basic indicators such as heart rate, blood oxygen and respiration rate. In addition, the Xuanji Sensing System has also expanded the research on emotional states based on heart rate data. It is not limited to physiological indicators, but can also evaluate the user's emotional state and stress level. It supports the monitoring of more than 60 sports health indicators, covering cardiovascular, respiratory, neurological, endocrine,

Full analysis of Go language file renaming operation Full analysis of Go language file renaming operation Apr 08, 2024 pm 03:30 PM

The os.Rename function is used in Go language to rename files. The syntax is: funcRename(oldpath,newpathstring)error. This function renames the file specified by oldpath to the file specified by newpath. Examples include simple renaming, moving files to different directories, and ignoring error handling. The Rename function performs an atomic operation and may only update directory entries when the two files are in the same directory. Renames may fail across volumes or while a file is in use.

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

See all articles