Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Lucas Tiago de Moraes  >  Data Page  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example 1
Class: Data Page
Calculate entries of listings with pagination
Author: By
Last change:
Date: 1 year ago
Size: 501 bytes
 

Contents

Class file image Download
<?php
include_once 'DataPage.php';

$page = isset($_GET['page']) ? $_GET['page'] : 1;

$datapage = new DataPage(20010$page8);

echo 
"<a href='?page=".$datapage->first_page()."'>First page</a> -";

for(
$i=$datapage->start_number(); $i<=$datapage->end_number(); $i++){
    if(
$i == $datapage->current_page){
        echo 
" <strong>$i</strong> ";
    }else{
        echo 
" <a href='?page=$i'>$i</a> ";
    }
}

echo 
"- <a href='?page=".$datapage->last_page()."'>Last page</a>";
?>