In php, upload images in the lower part, path pairs, and image paths can also be inserted into the database, but the lower part cannot be uploaded to the folder where the images are stored.

Source: Internet
Author: User
Php allows you to upload images, path pairs, and image paths to the database. However, you cannot upload images to the php folder where images are stored. path pairs and image paths can also be inserted to the database, however, the image cannot be uploaded to the folder where the image is stored. & lt ;? Phpinclude ("../conn. php"); if ($ _ POST ["submit"]! = "") {I php can upload images, path pairs, and image paths to the database, but cannot upload images in the folder.
Upload images, path pairs, and image paths in php can also be inserted into the database, but they cannot be uploaded to the folder where images are stored.
------ Solution --------------------
Include ("../conn. php ");

If ($ _ POST ["submit"]! = ""){
If (! Is_dir ("/up ")){
Mkdir ("/up ");
}
$ Path1 = "up/". $ _ FILES ["pic1"] ["name"]; // Picture
Move_uploaded_file ($ _ FILES ["pic1"] ["tmp_name"], $ path1 );

$ Path2 = "up/". $ _ FILES ["pic2"] ["name"]; // Picture
Move_uploaded_file ($ _ FILES ["pic2"] ["tmp_name"], $ path2 );

$ Path3 = "up/". $ _ FILES ["pic3"] ["name"]; // Picture
Move_uploaded_file ($ _ FILES ["pic3"] ["tmp_name"], $ path3 );

$ Path4 = "up/". $ _ FILES ["pic4"] ["name"]; // Picture
Move_uploaded_file ($ _ FILES ["pic4"] ["tmp_name"], $ path4 );

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.