How to update profile picture on a webpage using HTML, CSS, JAVASCRIPT & PHP

This code creates a form that allows users to select an image file and submit it to the server for uploading. The JavaScript code listens for a change in the file input and updates the src attribute of the current profile picture `img` element. It also listens for a submit event on the form and makes a POST request to the server using fetch to upload the image. The PHP code on the server processes the uploaded image and returns a JSON response indicating whether the upload was successful or not.