i really can figure out how pagination works..
suppose i have 2 files ok.php and pagin.ph
ok.php containts some details.

<?php
echo date("Y/m/d");
echo "<br />";
echo date("Y.m.d");
echo "<br />";
echo date("Y-m-d");
echo"<br/>";
echo date("h:i:s" ,time());

$i=0;
$display = 25;
while($i<10)
{
$x=0;
while($x<$display){
echo "$x hello World <br/>";
$x+=1;
}

$i += 1;
}
$display = 25;
if (empty($startrow)) {
    $startrow=0;
}


?>

and pagin.php is my pagination

<?php
$pagin = "<div id=\"options\">\r\n";
$start = 1;
$show = 10;
$current = 9;
$increment = 1;
if ($current <> 1){ $pagin .= "<a href=\"ok.php/" . ($current - 1) . ".php\">Previous</a>\r\n";
}
for ($i = $start; $i <= $show; $i += $increment) {
if ($i == $current) {
$pagin .= "$i\r\n";
} else {
$pagin .= "<a href=\"ok.php/$i.php\">$i</a>\r\n";
}
}
$pagin .= "<a href=\"ok.php/" . ($current + 1) . ".php\">Next</a>\r\n";
$pagin .= "</div>";
print $pagin;
?>

my problem is how ami going to display 25 hello world per page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.