一次上傳多個文件
[img]http://file:///D:/1.jpg[/img]
請問下這種類型的能隨意增加減少上傳圖片的input要怎麼實現,有人能幫我寫個這樣的代碼麼?且並接收的頁面要能成功的接收到這邊傳過去的圖片
最佳答案[url=http://www.111cn.cn/bbs/space.php?username=E網逍遙]鏈接標記E網逍遙[/url]
[url=http://www.111cn.cn/bbs/space.php?uid=58710]鏈接標記[img]http://www.111cn.cn/server/avatar.php?uid=58710&size=small[/img][/url]
$ScriptName = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$mname = "xchngg";
$mpass = "123456";
$mpath = trim($_POST['mpath']);
$Submit = trim($_POST['Submit']);
$action = trim($_GET['action']);
$username = trim($_POST['username']);
$password = trim($_POST['password']);
if($Submit != "" && $mname == $username && $mpass == $password){
if($mpath != "")$mpath = $mpath."/"; //上傳路徑
foreach($_FILES['fname']['name'] as $key=>$val){ //數組上傳文件
$fname = $mpath.$val;
if ( $_FILES['fname']['error'][$key]>0 || $_FILES['fname']['size'][$key]==0) {
continue;
}
if (@move_uploaded_file($_FILES['fname']['tmp_name'][$key], $fname)) { //上傳文件
$message .="