1){ // is the page number more than 1? $prev = ($page - 1); // if so, do the following. take 1 away from the current page number echo ''; // echo a previous page link } if($page < $total_pages){ // is there a next page? $next = ($page + 1); // if so, add 1 to the current echo ''; // echo the next page link } } } ?>