This is a discussion on "Listing a directory." within the PHP Forum section. This forum, and the thread "Listing a directory. are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Listing a directory.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Listing a directory.
I was wondering if any of you had a link to a tutorial for listing all the pictures in a directory? Thanks in advance!
|
|
|
|
#2
|
|||
|
|||
|
Using what language?
|
|
#3
|
|||
|
|||
|
If you want to do this in PHP then let me know as I can dig out the code...
|
|
#4
|
|||
|
|||
|
No way.. Go for JSP. It looks SO cool to see page.JSP!!!! lol, I love it... :razz: . heh..
|
|
#5
|
|||
|
|||
|
Yeah, it's php. I hate using javascript. I know how to do it if the files have sequential numbers after. I want it so it gets every file no matter what the file name. And Jpg's, Gif,s and Png's. If you could show me how to do this I'd definitely appreciate it.
|
|
#6
|
|||
|
|||
|
This is the code you need...
Also bear in mind that I used a variable $fullurl which isn't declared in the code. Replace it or declare it for yourself. Obviously you can tweak the code so that it displays the actual images, or whatever you like. It's also possible to filter files by their extension, but I'll let you try to figure that our for yourself first. |
|
#7
|
|||
|
|||
|
Thanks. All I really needed to know what the readdir and closedir statements.
|
|
#8
|
|||
|
|||
|
Why not just open the directory usig opendir() function and then use while to loop through. Then run a while with its expression to assign its readdir result to another variable. Within while, if the directory has a directory in it, print a hard-coded "D" and then print the file names inside, using the file variable. Then use closedir to close it.
|
![]() |
| Tags |
| listing, directory |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Directory listing using PHP | djeyewater | PHP Forum | 4 | Apr 2nd, 2008 17:09 |
| #1 (permalink) Free Listing To PR3 Web Design Directory! No recip! | vcsonline | Link Building and Link Sales | 0 | May 29th, 2007 13:43 |
| Listing website | Kwabena | Website Planning | 3 | May 14th, 2007 21:14 |
| Listing files in a folder | ismilelots | PHP Forum | 5 | Feb 15th, 2007 18:49 |
| Business listing | povidiu | Link Building and Link Sales | 0 | Sep 21st, 2006 09:41 |