Home >>Advance PHP Tutorial >Create Image Gallery in php

Create Image Gallery in php

Create image gallery in php

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.

Create an index.php

gallery1 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

create an upload.php file

gallery3 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.

create a gallery.php file

gallery2 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