Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Incrementing and decrementing URL variables

    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;&n bsp;&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!

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,039
    Thanks
    19
    Thanked 42 Times in 42 Posts
    try something like this

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •