PHP Batch upload pictures of the specific implementation methods introduced. _php Tips

Source: Internet
Author: User

You can use the following section of code to specifically understand the PHP bulk upload pictures of the specific way. When we are learning PHP, we must accumulate experience from the actual operation to consolidate the knowledge we have learned and gradually strengthen our programming level.

PHP Protection of file system specific code sharing
PHP Specific code example for protecting a database
• Explore the main areas of PHP application
• Application analysis of Ajax technology based on PHP
PHP to limit the size of the upload file the php batch upload picture code is as follows:

Copy Code code as follows:

<
Html
>

<
Head
>
<
Title
>
Uploadpicturemoreonce
</
Title
>
</
Head
>

<
Body
>

<
Form

action=
""
Method=
"POST"
Enctype=
"Multipart/form-data" >

<

>
Pictures:
<
Br

/>

<
Input

Type=
"File"
Name=
"Pictures[]"
/>
<
Br

/>

<
Input

Type=
"File"
Name=
"Pictures[]"
/>
<
Br

/>

<
Input

Type=
"File"
Name=
"Pictures[]"
/>
<
Br

/>

<
Input

Type=
"Submit"
Name=
"Upload"
Value=
"Send"
/>

</

>

</
Form
>

</
Body
>

</
Html
>

?
Php

if ($_post[' upload ']== ' Send ') {

$dest _folder=
"Picture/" 18.if (!file_exists ($dest _folder)) {19.mkdir ($dest _folder);

}

foreach ($_files["Pictures"] ["Error"]as$
key=
>
$error) {

if ($
ERROR==UPLOAD_ERR_OK) {

$tmp _name=$_files["Pictures" ["Tmp_name"] [$key];

$name =$_files["Pictures" ["Name"] [$key];

$uploadfile = $dest _folder $name; 26.move_uploaded_file ($tmp _name, $uploadfile);

}
}
}
?>


The above code is a lot of PHP upload pictures of all programming, hope to have the help of students need.

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.