多文件上傳的例子
//upload_html.php---------------------------------------------------------------------------------------------
<HTML>
<HEAD>
<TITLE>上傳文件</TITLE>
</HEAD>
<script>
function beforesubmit(forma)
{
var indexnamea=forma.indexname.value;
var upfilea=forma.upfile.value;
var k=/ /g;
var indexnamea=indexnamea.replace(k,"");
var upfilea=upfilea.replace(k,"");
if(indexnamea==""
upfilea=="")
{
alert("目錄名稱或上傳的目錄不能為空!");
return false;
}
return true;
}
</script>
<BODY BGCOLOR=WHITE>
<BR>
<form name=form1 action="upload.php" method=post enctype="multipart/form-data" >
";
<table cellspacing="1" cellpadding="5" border="0" width="580" bgcolor="#C2E2F5">
<tr bgcolor="#E3F2FB" align="center">
<td width="280" align="center" height="30">上傳的文件</td>
</tr>
<?
for($i=1;$i<8;$i++)
{
$upfile="upfile".strval($i);
echo " <tr>
";
echo " <td bgcolor=#F5FBFE width=264><input type=file name=$upfile lengh=25></td>
";
echo " </tr>
";
}
?>
<tr bgcolor="#E3F2FB">
<td colspan="2" height="1">
</td>