Its been a while since I updated my pagination on my web page and I\'m trying to add First and Last Links to my pagination as well as the ...
I am not sure what your 's' and 'p' $_GET variables are for (salt and pepper?), so i am just working with the 'p', for page.
1) {
echo '
';
$current_page = ($start/$display) + 1;
//add this here... first will always be one
echo 'First';
if ($current_page != 1) {
echo 'Previous ';
}
for ($i = 1; $i <= $pages; $i++) {
if ($i != $current_page) {
echo '' . $i . ' ';
} else {
echo '' . $i . ' ';
}
// add this here...
if ( $i == $max){
// stop the for() loop
break;
// not so fancy way of displaying last two pages, use other example if you want to get fancy.
echo ''.($pages - 1).' ';
echo ''.($pages).' ';
}
}
if ($current_page != $pages) {
echo 'Next';
}
echo 'Last';
echo '
';
}
?>