PHP Code:
if(1<$pgs)
{
echo"<div class=\"pagin\">";
if($pg>3){echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=1\">«</a></span>";}
{
if($pg>1){$pp1=$pg-1;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&$pp1&cid=$cat[0]\"><</a></span>";}
}
if($pg>=3){$pp2=$pg-2;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$pp2&cid=$cat[0]\">$pp2</a></span>";}
if($pg>=2){$pp3=$pg-1;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$pp3&cid=$cat[0]\">$pp3</a></span>";}
echo"<span class=\"current\">$pg</span>";
if($pg<=$pgs&&$pg<=$pgs-1){$np1=$pg+1;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$np1&cid=$cat[0]\">$np1</a></span>";}
if($pg<=$pgs-2){$np2=$pg+2;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$np2&cid=$cat[0]\">$np2</a></span>";}
if($pg<=$pgs-1){$np3=$pg+1;echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$np3&cid=$cat[0]\">></a></span>";}
if($pg<=$pgs-3){echo"<span class=\"pages\"><a href=\"view.php?action=vsites&pg=$pgs&cid=$cat[0]\">»</a></span>";}
echo"</div>";
}
$cats=MySQL_Query("SELECT * FROM cats;");
while($cat=MySQL_Fetch_Array($cats))
but not getting where to put. I tried but not getting exact result
Comment