Ok.. I'm just about ready to smash my head in on this one..
I have a image gallery set up with next and previous links..
The link takes the current id number of the image displayed, increases or decreases the value by one, and places it into the link referring back to the same php file in place of the old image id. Well.. It's supposed to anyway.
Here's the problem... my Previous link works flawlessly.. yet when I use the exact same code with a ++ instead of a -- before the variable name it doesn't do anything. it returns the same value as before.
ie.. $pid = 10.
if I run a echo --$pid; I get a value of 9. Perfect.
if I run a echo ++$pid; I get a value of 10.. the same number as before.
Now if that wasn't odd enough (well, to me anyways, a newb.) I tried the following:
<? $pid + 1; echo $pid; ?>
what I ended up getting was that the number started decreasing in value. So.. instead of adding a 1 to the value, it was subtracting it.
I'm at my wit's end here. I've been working on this webpage for going on 7 hours now.. this is the last thing that has to be done for today (other than some purely cosmetic changes) and I just can't figure out what I'm doing wrong.
After looking over my code numerous times, I can't find a single thing wrong with it. If anyone can point out an obvious glaring error I made and tell me how stupid I am and how to fix it, I'd be grateful.
Edit: Here's the actual code being used.
Previous link:
<a href="sswin.php?gid=<? echo $gid; ?>&pid=<? echo --$pid; ?>">« <font face="Verdana, Arial, Helvetica, sans-serif">Prev</font></a>
That one works perfectly.
Next link:
<a href="sswin.php?gid=<? echo $gid; ?>&pid=<? echo ++$pid; ?>"><font face="Verdana, Arial, Helvetica, sans-serif">Next</font> »</a>
This one doesn't.