Listing files in a directory - 50 / page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Listing files in a directory - 50 / page

Post by jkashu »

I need to list the files in a directory such that the listing shows 50 files and then you can hit "next page" to go to the next 50 files... I can list ALL the files on one page easilly, but what is the best way to list 50 per page?? Would I GET the range of files for each page (ie listing.php?start=1&end=50 )?? Thanks!
kryles
Forum Contributor
Posts: 114
Joined: Fri Feb 01, 2008 7:52 am

Re: Listing files in a directory - 50 / page

Post by kryles »

use the SQL LIMIT and OFFSET to get the right values from the query.

I'm a little too :banghead: to get it all working, but that may start you on the right path.....

Edit: Wow directories.....ok this probably wasn't helpful at all then, I assumed right away it was a query. Sorry =/
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Listing files in a directory - 50 / page

Post by Christopher »

Search these forums for "pagination". There are a couple of pagination classes in Code Snippets.
(#10850)
Post Reply