Upload multiple files at once
[Img]http://file:///d:/1.jpg[/img]
I ask this type of can be arbitrarily increased to reduce the upload image of the input to how to achieve, someone can help me write a code like this? and receive the page to be able to successfully receive this pass the picture
Best answer [url=http://www.111cn.cn/bbs/space.php?username=e net carefree] link Mark e-net carefree [/url]
[url=http://www.111cn.cn/bbs/space.php?uid=58710] link marker [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. " /"; Upload path
foreach ($_files[' fname ' [' name '] as $key = $val) {//array upload file
$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)) {//upload file
$message. = "
$val Upload succeeded (". $_files[' fname ' [' Size '] [$key]." bytes).
";
$file _num + +;
}else{
$stat = "Error";
$message. = "
$val upload failed!
";
}
}
}
?>
<title>Dynamic Multi-File upload</title>
Copy Code
d8888d Huitie Content-------------------------------------------------------
$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. " /"; Upload path
foreach ($_files[' fname ' [' name '] as $key = $val) {//array upload file
$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)) {//upload file
$message. = "
$val Upload succeeded (". $_files[' fname ' [' Size '] [$key]." bytes).
";
$file _num + +;
}else{
$stat = "Error";
$message. = "
$val upload failed!
";
}
}
}
?>
<title>Dynamic Multi-File upload</title>
Copy Code
http://www.bkjia.com/PHPjc/632542.html www.bkjia.com true http://www.bkjia.com/PHPjc/632542.html techarticle upload multiple files at once [img]http://file:///d:/1.jpg[/img] ask this type of can be arbitrarily increased to reduce the upload image of input How to achieve, someone can help me write a code like this ...