当前位置: 首页 > 图文教程 > 网络编程 > PHP > 建立文件交换功能的脚本(二)

PHP
PHP删除MYSQL数据库中所有表的代码
php教程:php设计模式介绍之注册模式
php教程:php设计模式介绍之伪对象模式
PHPnow轻松打造专业PHP服务器环境
php教程:php设计模式介绍之策略模式
php教程:php设计模式介绍之迭代器模式
Windows环境下Apache与Tomcat共存
简单学习php遇到的主要问题
php教程:php设计模式介绍之观测模式
php教程:php设计模式介绍之规范模式
php教程:php设计模式介绍之代理模式
php教程:php设计模式介绍之装饰器模式
Perl操作mysql数据库的方法
php教程:php设计模式介绍之适配器模式
PHP单件模式和命令链模式的基础知识
PHP大师指点:优秀的PHP代码怎么来?
PHP开发的Myers 订单跟踪系统 (MOTS)
PHP控制网页过期时间的程序
Cannot modify header information出错的原因
PHP 5.3的date_create_from_format()函数

PHP 中的 建立文件交换功能的脚本(二)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 208 ::
收藏到网摘: n/a

//upload.php
这是上传文件的界面,用任何一个编辑器都可以作出来很好看的。需要注意的是表格中的
ENCTYPE="multipart/form-data"部分。这个一定不能错,否则服务器将不知道你在上传文件。
其他的就没有什么好说的啦,嘻嘻,大家可以作个更好的。
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<FORM ENCTYPE="multipart/form-data" NAME=myform ACTION=do.php METHOD="POST">
<table width="600" border="1" cellspacing="0" cellpadding="0" align="center" height="160" bgcolor="#E2E3FE" bordercolorlight="#006699" bordercolordark="#FFFFFF">
<tr>
<td colspan="4" height="40">
<div align="center">文件上传</div>
</td>
</tr>
<tr>
<td width="80" height="40">
<div align="center">选择上传文件</div>
</td>
<td width="170" height="40">
<div align="left">
<input type="file" name="myfile">
</div>
</td>
<td width="80" height="40">
<div align="center">选择文件类型</div>
</td>
<td width="170" height="40">
<div align="left">
<select name="type" size="1">
<option value="通知" selected>通知</option>
<option value="下发文件">下发文件</option>
<option value="上报文件">上报文件</option>
</select>
</div>
</td>
</tr>
<tr>
<td width="80" height="40">
<div align="center">上传者</div>
</td>
<td width="170" height="40">
<div align="left">
<input type="text" name="uploader" maxlength="20">
</div>
</td>
<td height="40">
<div align="center">上传日期</div>
<div align="left"> </div>
</td>
<td height="40">
<input type="text" name="date" value="<? print(date("Y-n-j")); ?>">
</td>
</tr>
<tr>
<td height="40">
<div align="center"></div>
<div align="left"></div>
<div align="center"></div>
<div align="center">文件说明 </div>
</td>
<td colspan="3" height="40">
<input type="text" name="fileshow" size="60">
</td>
</tr>
<tr>
<td colspan="4" height="40">
<div align="center">
<input type="submit" name="Submit" value="上传">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>