Home Picture Carousel, click the picture to enter the corresponding article question

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

  • 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.