brown234 Posted January 3, 2019 Share Posted January 3, 2019 (edited) how to upload multiple image, preview image, add file path to database and display image Edited January 3, 2019 by brown234 Link to comment Share on other sites More sharing options...
Ingolme Posted January 3, 2019 Share Posted January 3, 2019 You'd start off with multiple <input type="file"> elements, you'd have some PHP code which gets the files from the $_FILES array and saves them into specific directories. You would then have some code to write the paths of the saved files into the database along with any other information about the image. On other pages of your site, you would have some code that pulls image information from the database and prints <img> tags with the saved paths. Here are the tutorials you should read to accomplish these tasks. Form Handling File Uploading Database Tutorial (12 pages) All this assumes you know the basics: variables, loops, functions. If you don't know the basics, just read the whole PHP tutorial from start to end. Link to comment Share on other sites More sharing options...
brown234 Posted January 3, 2019 Author Share Posted January 3, 2019 thanks, question is after saving the images in my server, how do i display the individual image with database filepath in mind? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 3, 2019 Share Posted January 3, 2019 You just need to write out an img tag with the correct URL to the image. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now