Image gallery is a way of displaying the different images that are saved by the user at a specific location. here the different images are uploaded by user in a specified folder. for displaying the images first of all we need to read the directory containing the different images, and there after reading display the images one by one.
in the above example in an index.php we have created two hyperlinks. one is to upload the images and other one is to show upload images. if the user has clicked on upload button he will be redirected to upload.php and if the user as clicked on image gallery he will be redirected to gallery.php
in upload.php if the image that user want to upload already exist he will not be allowed to upload an image and show an error message given image name already exist. otherwise he will be able to upload image successfully.
in gallery.php the folder in which images uploaded by the user are stored is included and is first open ,then readed, and thereafter the different images stored in that folder are displayed one by one