View Full Version : Incrementing and decrementing URL variables

11-10-2006, 09:29 PM
Hello. I am trying to use PREVIOUS and NEXT arrows to increment the variable "id" in the URL string so that each time a button is selected, the the id will be incremented or decremented thus pulling all ids with "2" or "0" (depending on what arrow is clicked) out on the next page. Here is what I have so far:

<div align="center">

<div id="image_navigation"> <a href="gallery.php?id=<?php echo $row_Recordset1['id']-1; ?>"><img src="../images/previous.jpg" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="gallery.php?id=<?php echo $row_Recordset1['id']+1; ?>"><img src="../images/next.jpg" border="0" /></a>



The site where this is not working is:


As you can see, the arrows do not +1 or -1 when clicking on the arrows. Help please!

11-10-2006, 09:35 PM
try something like this

$nxtlink = $row_Recordset1['id']++;
$prevlink = $row_Recordset1['id']--;
//i think you no wat to do now