double $_GET problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arbitter
Forum Newbie
Posts: 24
Joined: Tue Dec 29, 2009 10:04 am

double $_GET problem

Post by arbitter »

So the thing is, I have 2 $_GET parameters.

first one:

Code: Select all

<tr><td style='cursor:pointer;cursor:hand' onclick=\"location.href='?month=$qmap&sort=$sort'\"><center>$map</td></tr>
So then I say:
$month = $_GET["month"];
($qmap is the same as $map, only a full url (maintains spaces)

for the second one:

Code: Select all

<td><td style='cursor:pointer;cursor:hand' onclick=\"location.href='?month=$qmap&sort=ksort'\"><center>Oldest</td>
and so I can do $sort = $_GET["sort"]

So I have a column on the right displaying all albums (the $map 's), and if I click on one of those albums, all the photos in that album get shown on the right hand side of the page. Now I want to be able to let the people choose in what order the pictures are displayed. So I've added 2 buttons, one with "location.href='?month=$qmap&sort=ksort'\"" and one with "location.href='?month=$qmap&sort=krsort'\"". like that i can get the 'sort' and simply use that string in displaying the photos.

Now the problem is that if I click on on of the sort-links, it also goes to the last album in the list. This could possibly be because i've used a foreach to display all the folders of albums, and that it always takes the last $map that was made in the foreach. Is this the reason, is it possibly another reason, and how do I fix it?

I'm still a starter programmer so don't explain to vague if you mind..
Thank you!
Post Reply