Results 1 to 2 of 2
  1. #1
    Action Jackson - King of the World
    Join Date
    January 18th, 2005
    Posts
    2,201
    Pagination
    I am having a heck of time doing pagination for pages for some reason. I can't decide whether I should just do a next and prev or display all the page numbers.

    This is what I have for code so far:

    <table width=100% align=center>
    <tr>
    <td align=center>

    <?
    $limit=6;
    if($page != 1){
    $pageprev = $page-1;
    }

    $numofpages = ($totalrows / $limit);
    for($i = 1; $i <= $numofpages; $i++){
    if($i == $page)
    echo($i." ");
    else
    echo("<a href=\"index-links.php?interest=$interest&page=$i\"><font size=+1>$i</font></a> |
    ");
    }

    if(($totalrows % $limit) != 0){
    if($i == $page)
    echo(" ");
    else
    echo("<a href=\"index-links.php?interest=$interest&page=$i\"><font size=+1>$i</font></a> |
    ");
    }

    if(($totalrows - ($limit * $page)) > 0){
    $pagenext = $page+ 1;

    }else

    mysql_free_result($result);

    ?>

    </td>
    </tr>
    </table>



    For some reason it is not displaying the pages at all and I can't seem to figure out why. Anyone have any ideas?

  2. #2
    Member esnagel's Avatar
    Join Date
    January 1st, 2008
    Location
    Buffalo, NY
    Posts
    88
    Look at http://pear.php.net/package/Pager - while it may take a while to get set-up, once you have it working, it's very easy to use and customize.

  3. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. pagination within a category
    By Sharan in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: August 18th, 2010, 04:18 PM
  2. Pagination
    By drumminlogan in forum PopShops
    Replies: 6
    Last Post: November 21st, 2008, 06:01 PM
  3. Pagination change
    By msladybug in forum PopShops
    Replies: 7
    Last Post: November 29th, 2007, 10:26 AM
  4. advanced pagination
    By jackson992 in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: October 10th, 2004, 02:33 AM
  5. Using webmerge for pagination
    By dak142 in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: July 22nd, 2004, 07:23 AM

Posting Permissions

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