double $_GET problem
Posted: Mon Jan 18, 2010 10:06 am
So the thing is, I have 2 $_GET parameters.
first one:
So then I say:
$month = $_GET["month"];
($qmap is the same as $map, only a full url (maintains spaces)
for the second one:
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!
first one:
Code: Select all
<tr><td style='cursor:pointer;cursor:hand' onclick=\"location.href='?month=$qmap&sort=$sort'\"><center>$map</td></tr>$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>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!