Upload multiple files at once _php tutorial

Source: Internet
Author: User
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.