Welcome Guest, Not a member yet? Register   Sign In
Sortable lists using PHP
#1

[eluser]tim1965[/eluser]
Hi

I am trying to create a list of images that allows the user to set the order in which they are displayed.
So i would display a list of say 5 images and add two links to each image one to move the image up the list and the other to move the image down the list.
So my list would be
Quote:[1] image 1
[2] image 2
[3] image 3
[4] image 4
[5] image 5
So for image 4 if i hit the up link the list would become
Quote:[1] image 1
[2] image 2
[3] image 4
[4] image 3
[5] image 5

I would then save the new order into the db.
I am struggling to even come up with an approach on how to acheive this so i dont have any code currently.
I know i can do this using Javascript. But would prefer to handle this in PHP. So wanted to throw this out to see if anybody else has had to deal with a similar situation.
I hope the above is clear but let know if it isnt.
Thanks in advance for any contributions.


Messages In This Thread
Sortable lists using PHP - by El Forum - 10-08-2009, 12:52 AM
Sortable lists using PHP - by El Forum - 10-08-2009, 01:44 AM
Sortable lists using PHP - by El Forum - 10-08-2009, 02:39 AM
Sortable lists using PHP - by El Forum - 10-08-2009, 02:52 AM
Sortable lists using PHP - by El Forum - 10-08-2009, 02:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB