多文件上傳的例子
//upload_html.php--------------------------------------------- ------------------------------------------------
上傳檔案 <script> <br>function beforesubmit(forma) <br>{ <br> var indexnamea=forma.indexname.value; <br> var upfilea=forma.upfile.value; <br> var k=/ /g; <br> var indexnamea=indexnamea.replace(k,"); var upfilea=upfilea.replace(k,""); <br> if(indexnamea=="" <br> upfilea=="") <br> { <br> alert("目錄名稱或上傳的目錄稱為空!"); <br> return false; <br> } <br> return true; <br>} <br></script>
}
//----- -------------------------------------------------- -------------------------------------------------- --------------
//upload.php------------------------- -------------------------------------------------- ----------------------------------
//upload_path:檔案要上傳到的目錄路徑
for($i=1;$i{
$upfile="upfile".strval($i);
if(chop($ $indexname)!="" and chop($$upfile)!="")
{
$upfilename=($upfile."_name");
up$name=fileload_$$name=filename;
$copyfile = copy($$upfile,$filename);
if (!$copyfile)
1 ls =$$upfilename." n";
$flag=1 ;
}
}
if($flag){ >}
else{
$ls_msg="無檔案上傳,請重新選擇!";
}
echo "n
echo "n" ;
echo "n" ;
echo $ "n" ;
?>
http://www.bkjia.com/PHPjc/314784.html
www.bkjia.com
truehttp: //www.bkjia.com/PHPjc/314784.htmlTechArticle多重檔案上傳的範例//upload_html.php-------------- -------------------------------------------------- ----------------------------- HTML HEAD TITLE上傳檔案/TITLE /HEAD scrip...