This might sound a bit noobish but I am having trouble creating a increment/decrement button. So basically, I created a website that uses Tumblr feed to view photos that I've tagged. For example, if I pass a variable called "nav" that equals california, it will show all of my photos from california by using this code.

I want to be able to add a button to change the variable after "page/". And another thing is, the first page cannot read "page/1", because when I do it doesn't show anything. So the first page has to be the first script, and then after they press a "next" button, it has to go to the second code.

Of course, in order for this to work, you'll have to keep track of which page you're on. There are again several ways you could do this, but the easiest is probably to keep the current page number in a hidden form field. Then, just have a "next" button and a "previous" button, and check which one was clicked by testing to see if the appropriate $_POST index is set:

That should be enough to get you started. I'd also suggest thinking about how you can disable the previous or next buttons when you are on the first or last page of their range - with the code above, what happens if you click the "previous" button while you're on page 1? Then what happens if you click the next button?

If you have any questions or if I wasn't clear about something, please let me know and I'll try to explain further. =)

The "name" attribute is what corresponds to the key in the $_POST array (so, in this case, $_POST['previous']). The "value" attribute corresponds to the value stored in $_POST['previous'] when the script is called.