This post was last edited by q503959 on 2013-07-17 02:19:01
Requirements: When editing an article can upload images, uploaded images will be in chronological order on the home page scrolling, and then click on an image to enter the corresponding article
Can you give me a clue???? How to in the article has not been issued (the article ID in the database has not yet generated), the corresponding upload of the image attribution to the corresponding article?
Sina Online editor is used.
(If you have a better solution with other editors also recommend to me can I?) ~
There is a upload.php
if (function_exists (' Move_uploaded_file ')) {move_uploaded_file ($_files[' file1 '] [' tmp_name '], $realFile); $path =$ Upfiledir. $targetFile;//You can perform database operations $mysql=new MySQL (), $now _time=date ("y-m-d h:i:s", Time ()), $real _type=strtolower ($FILEEXT); $sql = "INSERT into file (Path,time,real_type,file_type) VALUES (' $path ', ' $now _time ', ' $real _type ', ' $type ') "; $mysql->query ($sql);} else{@copy ($_files[' file1 ' [' tmp_name '], $realFile);}
No previous request to click on the picture can enter the corresponding article, so I directly built a picture table to upload the image of the path to the carousel, now has the corresponding article this request .... I can't think of that.
Reply to discussion (solution)
Do you have to set up a field to associate the picture with the article?
The online editor provides a picture upload function and embeds the returned URL in the article
related fields I know ~ ~ ~ ~ ~ ~ The article has not been submitted ~ and the picture is uploaded first ~ ~ ~ The article ID has not been generated ~ The picture should be associated with which article ID?
Do you have to set up a field to associate the picture with the article?
The online editor provides a picture upload function and embeds the returned URL in the article
That's your problem, isn't it? No one else knows who's connected.
After the article ID is generated, you can associate all images that are not associated with the article ID
Of course, considering that there may be multiple users working at the same time, you also need to filter by user
Understand ~ Thank you brother Xu ~
That's your problem, isn't it? No one else knows who's connected.
After the article ID is generated, you can associate all images that are not associated with the article ID
Of course, considering that there may be multiple users working at the same time, you also need to filter by user