Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to List files from a folder with paging

    Please give me a simple tutorial listing files with limit and paging!

    <?
    $phpdir = "Files/";
    $dir = opendir ($phpdir);
    while ($file = readdir ($dir)) {
    if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php") && ($file != "style.css"))
    {
    echo '<a href="'.$phpdir.$file.'">'.$file.'</a>';
    }
    }
    ?>
    How can I make paging system with this that will show 10 files per page?

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,306
    Thanks
    57
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    The key word you should add to your google search is 'pagination'
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im not so smart bro!
    I got pagination script but I dont know how to use it!
    Please reply with a sample use


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •