+ Reply to Thread
Results 1 to 3 of 3

Thread: Page indexer ??

  1. #1
    thezone1 is offline x10 Sophmore thezone1 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    192

    Page indexer ??

    Hi people i currently have a script that displays images from a directory on a page

    PHP Code:
    $path "../../usr/{$user}/images/";
    $dir_handle = @opendir($path) or die("Error could not list image directory");
    while (
    $file readdir($dir_handle)) 
    {
       if(
    $file!="." && $file!="..")
          echo 
    "<img style=\"border:#FFF thin solid\" src=\"$dir$file\" height=\"55\" width=\"55\">";
    }
    closedir($dir_handle); 
    it works but now that users are starting to have more than 20 images in their directories my page design is suffering..

    So does anyone know of a script that will after the image count has reached 10 start a new page ??

  2. #2
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Page indexer ??

    PHP Code:
    $page intval($_GET['pn']);
    if(
    $page <= 0){
    $page 1;
    }
    $startnum $page 10;
    $endnum $startnum 10;
    $path "../../usr/{$user}/images/";
    $dir_handle = @opendir($path) or die("Error could not list image directory");
    while (
    $file readdir($dir_handle)) 
    {
    if(
    $startnum != $endnum){
       if(
    $file!="." && $file!="..")
          echo 
    "<img style=\"border:#FFF thin solid\" src=\"$dir$file\" height=\"55\" width=\"55\">";
    $startnum ++
    } else {
    closedir($dir_handle);
    }
    echo 
    "<a href=\"?pn=".$page-1."\">Previous 10</a> - ";
    echo 
    "<a href=\"?pn=".$page+1."\">Next10</a>"
    Just a note: I suggest you use databases as you can store more info and you can keep all the files in a specific order but your preference.
    Last edited by VPmase; 05-19-2008 at 04:29 PM.

  3. #3
    thezone1 is offline x10 Sophmore thezone1 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    192

    Re: Page indexer ??

    Many thanks for the script

+ Reply to Thread

Similar Threads

  1. contact page
    By cbcyouth in forum Programming Help
    Replies: 5
    Last Post: 12-20-2007, 02:15 PM
  2. cPanel page?
    By mikeyb0y in forum Free Hosting
    Replies: 6
    Last Post: 12-15-2007, 11:33 AM
  3. Passing variables from page to page
    By os242 in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-15-2007, 02:05 PM
  4. Redirection page
    By danatki in forum Free Hosting
    Replies: 3
    Last Post: 09-15-2007, 12:04 PM
  5. Scripts taking users to main domain page
    By zero5854 in forum Free Hosting
    Replies: 31
    Last Post: 08-07-2007, 12:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers