CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Post a PHP snippet (http://www.codingforums.com/forumdisplay.php?f=41)
-   -   php list images in directory (http://www.codingforums.com/showthread.php?t=284160)

basilis 12-14-2012 10:38 PM

php list images in directory
 
Hello.

I am new in programming.
I would appreciate some help.

I have a folder in my site where I save all images from snagit.
But instead of seeing file names, I would like to see the images themselves with the last ones uploaded on top.

Could you modify the file?
Thanks.

Code:

<body>

<?php
    if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle)))
    {
        if ($file != "." && $file != "..")
        {
            $thelist .= '<LI>
                       
                        <a href="'.$file.'">'.$file.'</a>';
        }
    }
    closedir($handle);
    }
?>

<P>List of files:</p>
<UL>
<P><?=$thelist?></p>
</UL>


 
 
 
 

</body>



All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.