Jump to content

Next And Previous Not Working


Guest menelaus

Recommended Posts

Guest menelaus

Ok I'm trying to edit a php site for a friend of mine. The person that made this site before I had gotten to it the php is overly complicated for what is trying to be done. Currently I just need to get the Next and Previous links working properly.When you click on a shopping cart item category you are brought to a page called shop-online.php in that page contains all the products related to that categroy. I have a loop setup to display items up to 3 across before starting a new row. That isn't the problem. To keep the page inline with its layout I modified a function to once a certain amount of items are on the page create a next & previous link to view rest of items.Now for one of the categories this works beautifully. But when you click on any other category that contains the required amount of content before the next and previous links will show... once they do you click on next and it brings you to the wrong categories contents. It will direct to the category the works perfectly.Here is the php code that creates the next and previous links... mind you I did not write this I'm trying to figure out why it does not work. My code is not this horrid.

<table border="0" align="center">	 <tr>	   <td><?php if ($pageNum_Recordsetproduct > 0) { // Show if not first page ?>			 <a href="<?php printf("%s?pageNum_Recordsetproduct=%d%s", $currentPage, max(0, $pageNum_Recordsetproduct - 1), $queryString_Recordsetproduct); ?>">Previous</a>			 <?php } // Show if not first page ?>	   </td>	   <td><?php if ($pageNum_Recordsetproduct < $totalPages_Recordsetproduct) { // Show if not last page ?>			 <a href="<?php printf("%s?pageNum_Recordsetproduct=%d%s", $currentPage, min($totalPages_Recordsetproduct, $pageNum_Recordsetproduct + 1), $queryString_Recordsetproduct); ?>">Next</a>			 <?php } // Show if not last page ?>	   </td>	</tr>   </table>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...