PHP多文件上传页面代码
<html>
<head>
<script language="JavaScript">
<!--
function sendsub(){
if(document.f6.sg.checked){
if (confirm("确定要覆盖上传吗?")){
setTimeout("document.f6.sg.checked=false;",999);
return true;
}
}else{
if(confirm("确定要上传吗?")){
return true;
}
}
return false;
}
var nfiles = 1;
function Expand(){
nfiles++;
if (nfiles>9) {
alert("每次上传最好小于10个文件");
}else {
file.insertAdjacentHTML('BeforeEnd','<br>文件'+nfiles+' <input type="file" name="File'+nfiles+'" size=23 class=fileput>');
}
self.document.f6.file_num.value=nfiles;
return false;
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" rightmargin=0 leftmargin=0 topmargin=0>
<table width="96%" border="0" cellspacing="2" cellpadding="2" align="center">
<form action="upload.php" enctype="multipart/form-data" method="post" onSubmit="return sendsub();" name="f6">
<tr bgcolor="#AC9988">
<td height="20"><a onClick="return Expand();" style="cursor:hand">增加文件</a>
</td>
</tr>
<tr bgcolor="#E7E1DC">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div id=file>文件1
<input type="file" name="File1" class=fileput size="23">
</div>
</td>
</tr>
</table>
</td></tr>
<tr bgcolor="#E7E1DC"><td>
<input type=hidden name='file_num' value=1>
<input type="submit" value="开始上传" class=btn name="submit">
</td>
</tr>
</form>
</table>
</body>
</html>
- 最新评论