I have this code for pagination
<?
session_start();//start session for this page
$array = $_SESSION['arrayData'];
$page = $_REQUEST['pagenum'];
$currentpage = isset($page) ? (integer)$page : 1;
$numperpage = 10; //number of records per page
$total = count($_SESSION['arrayData']);
$numofpages = ceil($total / $numperpage); //total num of pages, oh yeah don't forget to round up
if(isset($array)){
if (($currentpage > 0) && ($currentpages <= $numofpages)) {
//yes pages are required and current page is ok
//show data array
$start = ($currentpage-1) * $numperpage;
for($i=$start;$i<=($numperpage+$start-1);$i++) {
if (isset($array[$i]))
echo $array[$i] .'<br />';
}
if ($currentpage != 1) {//can't go back from page 1
$previous_page = $currentpage - 1;
$previous = '<a href="page.php?pagenum='. $previous_page .'"><< Previous</a> ';
}
$pages_html = ' Pages: ';
for ($a=1; $a<=$numofpages; $a++) {
if ($a == $currentpage) {
$pages_html .= $a .'</u>, ';
} else {
$pages_html .= '<a href="page.php?pagenum='. $a .'" >'. $a .'</a>, ';
}
}
$pages_html = substr($pages_html,0,-2); //remove the last ,
if ($currentpage != $numofpages) {//can't go forward if we are on the last page
$next_page = $currentpage + 1;
$next = ' <a href="page.php?pagenum='. $next_page .'">Next >></a>';
}
echo '<br /><br />'. $previous . $pages_html . $next; //hyperlinks controls
}
if (isset($_REQUEST['destroy']))
session_destroy();
}else{
$arrayData = array();
for($x=0;$x<104;$x++){ //fill array data
$arrayData[] = "number: $x";
}
$_SESSION['arrayData'] = $arrayData; //register it with session
header("Location: {$_SERVER['PHP_SELF']}");
}
?>
but could someone tell me how I could adapt it for the content on my site (http://xuroq.co.uk), so it displays a certain number of items per page
thanks