Jump to content

Writting a script to arrange images........ need some help


TGWSE_GY

Recommended Posts

Ok so here is the link

 

http://hmtotc.com/dev/projects/vrassociates/jeweler_dev/admin/index.php?id=arrange&loc=4

 

I am wondering if there is a way to have the text field hold a hidden value so I can keep track of the image id so I can manipulate the order of the images once the submit button has been pressed. Maybe I am going about it the wrong way.

 

Thanks Guys

 

Should I just have a hidden field after each image and text field that has the row ID attached to it and just store all the values for both the text fields and hidden stored in arrays.

 

IE <input type="text" name="orders[]" value="1"><input type="hidden" name="rowids[]">

 

and then just itterate through the arrays at the same time?

 

Thanks

ok so

<input type="text" name="imgid[23]" value="2" width="5" ></td></tr><tr valign="top"><td><input type="submit" value="Change Image Order">

 

To access the value of 2 I would need to access imgid[23] to get the value of 2 but how do I grab the index of the array to use that data, as I know you can but I have never used the index of an array other than a pointer location?

u can grab the array keys with

$keys=array_keys($array)

 

this gives a new array of the keys

 

but if yer working with code an array element at a time

its easier using foreach

 

foreach($array as $key=>$val)

{

}

 

using foreach is by far very easy to use :)

<input type="text" name="orders[image_id]" value="1">

 

is there a way to get the value assigned as the value of "orders[image_id]" to where image_id key holds value="1" or if I am not mistaken that already happens by putting the name into an array correct?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.