來源:互聯網
上載者:User
關鍵字
例子
上傳
檔案
echo
upfile
var
td
i
多檔案上傳的例子//upload_html.php---------------------------------------------------------------------------------------------
上傳檔案
//-----------------------------------------------------------------------------------------------------------------------
//upload.php-------------------------------------------------------------------------------------------------------------
//upload_path:檔案要上傳到的目錄路徑
for($i=1;$i<8;$i++)
{
$upfile="upfile".strval($i);
if(chop($$indexname)!="" and chop($$upfile)!="")
{
$upfilename=($upfile."_name");
$filename=upload_path.$$upfilename;
$copyfile = copy($$upfile,$filename);
if (!$copyfile)
die("檔案上傳失敗!");
$ls_file.=$$upfilename."\n";
$flag=1 ;
}
}
if($flag){
$ls_msg="檔案\n".$ls_file."上傳成功!";
}
else{
$ls_msg="無檔案上傳,請重新選擇!";
}
echo "\n" ;
echo "\n" ;
echo "\n" ;
echo "\n" ;
echo $ls_msg."\n";
echo "\n" ;
echo "\n" ;
?>