DJTim666 Posted July 2, 2007 Share Posted July 2, 2007 I finally coded my first pagination script, and it works @_@. But there is one small problem. Instead of showing the <<Previous link it just shows < 1 2 3 4 5 6 7 8 Next>> Here is a snippet from the code where the problem lies <?php if($page > 1){ $prev = ($page - 1); echo "<a href='" . $PHP_SELF . "?page=$prev'><<Previous </a> "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "<a href='" . $PHP_SELF . "?page=$i'>$i</a> "; } } // Build Next Link if($page < $total_pages){ $next = ($page + 1); echo "<a href='" . $PHP_SELF . "?page=$next'> Next>></a>"; } ?> -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/58099-solved-my-first-pagination-script/ Share on other sites More sharing options...
irkevin Posted August 18, 2007 Share Posted August 18, 2007 i think instead of putting it like this <<previous put it like this in your code <<Previous it should work.. i thought i would share it.. maybe some people could need this piece of info Quote Link to comment https://forums.phpfreaks.com/topic/58099-solved-my-first-pagination-script/#findComment-327307 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.