Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Directories and Files questions?

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
parksmike
Asked:
parksmike
1 Solution
 
alfarodCommented:
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
 
nikottoCommented:
you could also try an existing script!
take a look at phpMyExlorer
http://elegac.free.fr/commun/index.php3?stats=true&langue=uk
0
 
snoyes_jwCommented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now