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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

<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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.