Current location: Hot Scripts Forums » Programming Languages » PHP » reorder random number of items in a form


reorder random number of items in a form

Reply
  #1 (permalink)  
Old 01-04-07, 01:59 PM
speedy33417's Avatar
speedy33417 speedy33417 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
reorder random number of items in a form

I'm trying to do something like what Netflix does to reorder your DVD queue. It will be used in the admin page in my photo album, where different albums contain different number of pictures.
I would display a text input box with the current value of the picture's order number and the thumb picture, loop it as many times as many picture I have and close it with a submit button.

My problem is I can do it with one variable, but I'm not sure how to loop it. I need to use either $pic1 $pic2 $pic3 $pic4 or $pic[1] $pic[2] $pic[3] $pic[4].
How do I send these variables using HTML forms and making up the full name of the variable in a loop on the fly?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-05-07, 03:33 AM
Wolf1994 Wolf1994 is offline
Wannabe Coder
 
Join Date: Sep 2005
Location: Russia
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

foreach ($pic as $k=>$v)

{
 print 
'<img src="..." />';
 print 
'<input type="text" value="'.$k.'" name="pic'.$k.'" /><br />';

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
excluding a number from a random stormshadow PHP 7 07-14-06 07:01 PM
Enter number and copy form (X) sharijl JavaScript 7 03-31-06 07:25 PM
how do i get the total number of listed items in a for loop? nassau PHP 3 02-07-05 10:09 PM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM
looking for a random number script ncben Script Requests 3 08-07-03 09:10 AM


All times are GMT -5. The time now is 05:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.