mysql - thinkphp3.2.3 uploads multiple images and passes them to three fields of the same data table
伊谢尔伦
伊谢尔伦 2017-05-16 13:01:00
0
4
525

I want to upload three pictures at the same time in one form, and upload them to three fields in the data table, namely preview1, preview2, preview3, but now only one picture can be uploaded. I would like to ask everyone for help. How should it be modified?
1. Front-end page

2. Backend code

< /p>

3. Database table

< /p>

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
迷茫

Is it because there is no multiple attribute in your front-end input?

黄舟

I suggest you write it in the form of asynchronous upload, then create three hidden inputs, and combine the uploaded image addresses and put them into the three inputs.

It is now very convenient to upload pictures asynchronously, unlike before.


If it is really not asynchronous, then you need to use a loop when processing on the backend, upload them one by one, and then combine the addresses and submit them to the database.

phpcn_u1582

There is documentation here: http://document.thinkphp.cn/m...

我想大声告诉你

Why not use asynchronous multi-image upload? Not only it’s easy to use, but also worry-free.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template