Folks,
Tell me, should I quote the number or not ?
The following php code is a pagination section like the bottom part of google SERP. The code builds the page numbers at the bottom of the SERP. Like: (Page 12345678910).
[code]
<?php
//$_GET PARAMS:
$search = ‘keyword’;
$tbl = ‘links’;
$col = ‘keyword’;
$max = ‘100’; //Should I quote this to turn it into NUMERIC or should I not quote it to turn it into INT ?
$page = ‘1’; //Should I quote this to turn it into NUMERIC or should I not quote it to turn it into INT ?
if(is_numeric($max))
{
echo “Numeric”;
}
if(is_int($page))
{
echo “Int”;
}
$selfpage = basename(__FILE__,”); //Echoes: url_encode_Template.php. Does not fetch the url $_GET params.
$path = rawurlencode($selfpage);
$query_string = ‘?search=’ .urlencode($search) .’&tbl=’ .urlencode($tbl) .’&col=’ .urlencode($col) .’&max=’ .intval($max) .’&page=’ .intval($page);
$url = $path .htmlentities($query_string); //$url value contains the Full URL With $_GET params: https://localhost/Templates/url_encode_Template.php?search=keyword&tbl=links&col=keyword&max=100&page=1
echo ‘<a href=’ .'”‘ .$url .'”‘ .’>Next</a>’; echo ‘<br>’;
?>
**Note these comments:
$max = ‘100’; //Shall I quote this INT/NUMERIC or not ?
$page = ‘1’; //Shall I quote this INT/NUMERIC or not ?
**Remember:
$max is the total links per SERP.
$page is the SERP number.
Usually, do you have these numbers $max, $page as INT or NUMERIC ?