Is My Pagination Numbering Correct?
It is pagination section. Like Google SERP. Like you see on bottom where you get page links like page 123456789. Can you tell me which WHILE loop is very much correct. And tell me why you think this one very much good. You will see two WHILEs below. One is commented-out. That one I think least good. And so, I commented-out. //PAGINATION SECTION TO NUMBER THE PAGES AND LINK THEM. // $total_pages = ceil($row_count/$max); $i = '1'; //$selfpage = $_SERVER['PHP_SELF']; $selfpage = basename(__FILE__,''); //Echoes: url_encode_Template.php. Does not fetch the url $_REQUEST params. $path = rawurlencode($selfpage); $query_string_1 = '?find=' .urlencode($find) . '&tbl=' .urlencode($tbl) . '&col=' .urlencode($col) . while($i<=$total_pages) { $query_string_2 = '&page=' .intval($i); $url = $path .htmlentities($query_string_1) .htmlentities($query_string_2); //Full URL With $_REQUEST params: https://localhost/Templates/url_encode_Template.php?find=keyword&tbl=links&col=keyword&max=100&page=1 if($page == $i) { echo '<a href=' .'"' .$url .'"' . '>' . '<b>' .intval($i) . '</b>' . '</a>'; } else { echo '<a href=' .'"' .$url .'"' . '>' .intval($i) . while($i<=$total_pages) { $query_string_2 = '&page=' .intval($i); if($page == $i) { echo '<a href=' .'"' . "$path" .htmlentities($query_string_1) .htmlentities($query_string_2) .'"' . '>' . '<b>' .intval($i) . '</b>' . '</a>'; } else { echo '<a href=' .'"' . "$path" .htmlentities($query_string_1) .htmlentities($query_string_2) .'"' . '>' .intval($i) . And, can you amend this code if you deem not good enough for XSS attack, javascript attack, etc. all hacker bad man attacks.