for($i = 1; $i <= $total_pages; $i++) { if($i == $page_number) { print "$i "; }
else { print "<a href="lists.php?page_number=$i">"$i"</a>"; } }
Hi, I try to implement a basic pagination system to view my table outputs divided into the pages. I sort out and write a code with my near to the zero knowledge however i'm stuck with a simple problem while creating the pagination links with a for loop and echo.
I used the above code to generate the links however the links generated by that code looks like this:
http://lists.php/?page_number=2
As it can be seen easily between "lists.php" and "?" a "/" automatically put by the code which breaks the link itself.
I'm sure this is a pretty easy to solve problem, but dont forget that i'm a newbie 🙂
I really appreciate for a solution, thx in advance : )