$display) { // More than 1 page. $num_pages = ceil ($num_records/$display); } else { $num_pages = 1; } } // End of np IF. // Determine what # to start returning results. if (isset($_GET['s'])) { $start = $_GET['s']; } else { $start = 0; } // Retrieve specific group of images from array for the page. print_r($list = array_slice($images, $start, $display)); if ($num_pages > 1) { echo '

'; // Determine what page the script is on. $current_page = ($start/$display) + 1; // If it's not the first page, make a Previous button. if ($current_page != 1) { echo 'Previous '; } // Make all the numbered pages. for ($i = 1; $i <= $num_pages; $i++) { if ($i != $current_page) { echo '' . $i . ' '; } else { echo $i . ' '; } } // If it's not the last page, make a Next button. if ($current_page != $num_pages) { echo 'Next'; } echo '

'; } ?>