PHP Classes

File: example

Recommend this page to a friend!
  Classes of ali mousa   paging_class   example   Download  
File: example
Role: Example script
Content type: text/plain
Description: example on using paging class
Class: paging_class
Generate links to browse lists split between pages
Author: By
Last change:
Date: 17 years ago
Size: 720 bytes
 

Contents

Class file image Download
<?php
   
require_once("paging.php");

   
$totalRecord = 20;
   
$recordPerPage = 4;
   
$pageURL = $_SERVER['PHP_SELF'];
   
$maxPaging = 3;
   
$userPaging = new paging($totalRecord , $recordPerPage , $pageURL ,$maxPaging);
   
$currPage = $_GET['page'];
   
//

    //set max number of page to be displayed
    //
   
print "we have $totalRecord , and we want to display $recordPerPage per page, and \n we want to display $maxPaging number of paging per page";
    print
"<br />";
   
$_GET['offset'] = (isset($_GET['offset'] )? $_GET['offset'] : 0);
    for(
$i=$_GET['offset'] ; $i < $_GET['offset']+$recordPerPage ; $i++)
    {
        print
"element #:" . ($i+1) ;
        print
"<br />";
    }
    print
$userPaging->display_paging($currPage);
?>