?
Solved

Directories and Files questions?

Posted on 2003-03-06
4
Medium Priority
?
287 Views
Last Modified: 2006-11-17
I am writing a file management program in PHP that lists the files of a certain file type in a named directory. Thsi directory has hundreds of files listed, What I want to do is to page the directory list to 20 or 30 file names per page.

I am using readdir to list the files.  The program also allows the user to select the listed files to Delete or Rename these files. Has anyone scripted anything like this?
0
Comment
Question by:parksmike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
alfarod earned 400 total points
ID: 8087040
Hi

The best way to split a list in several pages is to put the list into an array and define this array as a session variable.
Then you can navigate from page to page just changing the subset you want to display.

e.g.
You have this array $files
the page 1 shows from $files[0] to $files[19]
the page 2 shows from $files[20] to $files[39]
etc until the end of the array.





0
 

Expert Comment

by:nikotto
ID: 8099239
you could also try an existing script!
take a look at phpMyExlorer
http://elegac.free.fr/commun/index.php3?stats=true&langue=uk
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 11934099
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: alfarod {http:#8087040}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

snoyes_jw
EE Cleanup Volunteer
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question