Search⌘ K
AI Features

Replacing the Existing Image

Explore techniques for adding image links to edit forms and implementing reusable upload functions in PHP. Learn to replace existing images securely and display updates on tour details pages.

Adding a link to the picture on the edit form

Let’s take a look at the edit form for a tour that already has a picture. Go to http://APPLINK/list-tours, and find the tour for which you uploaded a picture. Now, click on the “Edit” button for this tour. There is no way to find out if you have already uploaded a picture by simply looking at the form:

We could show the uploaded picture here, just like we did on the tour details page, but the picture might be too large ...