Link Farm Code

  Home arrow Link Farm Code arrow Pagination
LINK FARM CODE

Pagination
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 25
    2004-04-12

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    / Pagination script

    /* This simple script automates the creation of navigation links for the datas extracted from
    the database.Pls Feel free to modify it and mailme back.Thanx
    Author: Sam George; ocptime@rediffmail.com
    Licence: GPL.
    */

    // No Files are included and stylesheets and other config files can be
    // included according to your wish.
    // Uses ADO_DB for database abstraction and no documentation as the script is fairly straight forward


    By : ocptime

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <!-- Creation Date: <?=Date("d/m/Y")?> -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Generator" content="Dev-PHP 1.9.4">
    <title>Document Title</title>
    </head>
    <body>
    <?php
    // Pagination script

    /* This simple script automates the creation of navigation links for the datas extracted from
    the database.Pls Feel free to modify it and mailme back.Thanx
    Author: Sam George; ocptime@rediffmail.com
    Licence: GPL.
    */

    // No Files are included and stylesheets and other config files can be
    // included according to your wish.
    // Uses ADO_DB for database abstraction and no documentation as the script is fairly straight forward


    $sqlCount="SELECT count(u.id) FROM msg_mail as m, user as u
    WHERE m.userTo='$userId'
    AND m.status <> 'trash'";

    $rsCount = $db->Execute($sqlCount);

    $totalrows = $rsCount->fields[0];


    $limit=5;

    if(empty($page)){
    $page = 1;
    }

    $limitvalue = ($page - 1) * $limit;

    $sql = "SELECT m.mailId, m.userTo, m.userFrom, ".$db->substr."(m.subject,1,25) as subject, m.status, u2.name, u.userName, m.date
    FROM msg_mail as m, user as u
    WHEREm.userTo='$userId'
    AND m.status <> 'trash'
    ORDER BY m.date DESC LIMIT $limitvalue, $limit";

    $rs = $db->Execute($sql);

    if($rs->RecordCount()>0){

    while($row = $rs->FetchRow()){

    $userTo=$row['userTo'];
    $userFrom=$row['name'];
    $mailId=$row['mailId'];
    $subject=$row['subject'];
    $message=$row['message'];

    //put uer <td> and <tr> here to fill the data
    }



    if($page > 1){
    $pageprev = $page-1;
    echo("<a href=\"mypage.php?page=$pageprev\">PREV</a>&nbsp;");
    }

    $numofpages = ceil($totalrows / $limit);

    for($i = 1; $i <= $numofpages; $i++){
    if($page == $i){
    echo($i."&nbsp;");
    }else
    echo("<a href=\"mypage.php?page=$i\">$i</a>&nbsp;");
    }

    if($page < $numofpages){
    $pagenext = ($page + 1);
    echo ("<a href=\"mypage.php?page=$pagenext\">NEXT</a>");
    }

    ?>
    </body>
    </html>

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Link Farm Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    LINK FARM CODE ARTICLES

    - FreshSoftware Banner Image Rotater
    - LinkMachine
    - Pagination
    - Ask and Receive version 2.0
    - MyLinks Version 1.1
    - Flexphplink Pro
    - Flexphplink
    - Please remove
    - Simple Outgoing Links/Url Hit Counter
    - PHP-LINKS


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap