Task E: Deleting Pictures
It’s reasonable for users to want to remove images they no longer wish to display. We need to provide a way for users to select images they wish to remove and tell the application about it. To delete a picture, we’ll do the following:
-
Delete the image
-
Delete the thumbnail
-
Delete the database entry for the image
-
Since the images can be removed only by the owner, we’ll check if the page matches the user in the session. When this is the case, we’ll allow the user to mark pictures he wishes to delete and submit his selection using the Delete button.
So far, we’ve only been creating static pages. Let’s look at how to add some client-side interaction using Ajax. In this section, we’ll include JavaScript in our page, call ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access