I'm able to display individual images by referring them using <img> tag but I have so many images so it would take lot of effort to refer every image individually.
Here is my php code
<?php
$folder_path = 'paintings/'; //image's folder path
$num_files = glob($folder_path . "*.{JPG,jpg,jpeg,gif,png,bmp}", GLOB_BRACE);
$folder = opendir($folder_path);
if($num_files > 0)
{
while(false !== ($file = readdir($folder)))
{
$file_path = $folder_path.$file;
$extension = strtolower(pathinfo($file ,PATHINFO_EXTENSION));
if($extension=='jpg' || $extension =='png' || $extension == 'jpeg'|| $extension == 'gif' || $extension == 'bmp')
{
?>
<a href="<?php echo $file_path; ?>"><img src="<?php echo $file_path; ?>" height="250" /></a>
<?php
}
}
}
else
{
echo "the folder was empty !";
}
closedir($folder);
?>
glob()returns an array with all your filepaths, not the number of files)>into>and all<into<... (So all our edits was wrong! LOL)