the code is below:
<title></title>
<?php
$start=1;
$tube=1; // this variable represents the current page that the customer is on
$repz=$start+9;
$derka=14; // the total number of products
$box_per_page=9;
$pages=ceil($derka/$box_per_page);
$sugar = array(1=>one,2=>two,3=>three,4=>four,5=>five,6=>six,7=>seven,8=>eight,9=>nine,10=>ten,11=>eleven,12=>twelve,13=>thirteen,14=>fourteen);
//if ($tube == 1){
// $start=10;
//}
// code to create number of individual pages!
//for ($p=0;$p<$pages;$p++){
//$tube++;
echo "<html>";
echo "Catalog on tube $tube";
echo "<table height='70%' width='70%' align='center'>";
// code for each individual product to be arranged correctly per page
for ($n=$start;$n < $repz;$n++){
if ($n==$start){
echo "<tr>";
}
echo "<td>$sugar[$n]</td>";
if (is_int($n/3) and $n>1){
echo "</tr><tr>";
}
if (is_int($n/$box_per_page) and $n>1){
echo "</table>";
$end=$n;
if ($tube > 1 and (($tube - 1) != 0)) {
$url = "test_Catalog.php?tube=" . $tube - 1;
echo "<a href=\"$url\">Previous</a>\n";
}
// page numbering links now
for ($i = 0; $i < $pages; $i++) {
$url = "test_Catalog.php?tube=" . $i;
echo " | <a href=\"$url\">$i</a> | ";
}
if ($tube < $pages) {
$url = "test_Catalog.php?tube=" . $tube + 1;
echo "<a href=\"$url\">Next</a>\n";
echo "</html>";
}
if ($start < $derka){
$start=$end+1;
echo "the variable start equals $start";
}
}
}
//}
?>