$page "; } } // create previous and next link and the link to go straight to the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " [Prev] "; $first = " [First Page] "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " [Next] "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation links echo '

' . $first . $prev . $nav . $next . $last . '

'; ?>