Home > Back-end >  How to let users upload or change the uploaded images in one page, and display it in another page?
How to let users upload or change the uploaded images in one page, and display it in another page?

Time:05-25

How to let user upload image in one page, and then display it in another page? User can change the image and it'll be changed also in the other page. Also, I'm talking about using php / js / jquery / mysqli anything that's most efficient. (I'm just a beginner in this field so it'll be appreciated if you use some simple language :))

Edit: Yes I said that I'm a beginner, but that doesn't mean I don't know a thing about coding. Also, I saw a few solutions from youtube & other stackoverflows questions, but all of them is about either uploading and displaying in the same page or not being able to change the image.

CodePudding user response:

  1. Format the image into Base64 string
  2. store it in local-storage
  3. In another page get it from local-storage and assign to the id or class.

Suggesting the link that already have answered for How to save an image to localStorage and display it on the next page?

CodePudding user response:

As am trying to understand your question. You can create page where user upload image and save name of it in database, another page where user can edit it. So on edit page user get image name from database, delete old one or overwrite it with new one. All can be done in php language. This is just an idea.

  • Related