...

View Full Version : Incrementing and decrementing URL variables



mjurmann
11-10-2006, 08: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>

</div>

</div>

The site where this is not working is:

http://www.hotheadbeads.com/htms/gallery.php?id=1

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

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



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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum