[PHP] A small problem with input feilds.

2002-12-05 Thread Mike
Hello everyone,
I have the following html code that is generated via a script:

table
 form action=/new/mp3/stuff/testsearch.php method=post target=

trtdbArtist/b/tdtdbTitle/b/tdtdbFile
Size/b/tdtdCheck/td/tr
 tr
  td width=295 valign=top
   pb Dj Ummet/b/p
  /td
  td width=195 valign=top
   pbPump This Party (extended Mix)/b
  /td
   td width = 195 valign = top
   bAbout 4.5 megabytes/b/p
  /td
  td valign=topinput type=checkbox name=file[]
value=%28Dj+Ummet%29+-+Pump+This+Party+%28Extended+Mix%29.mp3
   input type=hidden name=filenumber[] value=3437
  /td
 /tr
/tr
 tr
  td width=295 valign=top
   pb Metalica/b/p
  /td
  td width=195 valign=top
   pbEnter Sandman/b
  /td
   td width = 195 valign = top
   bAbout 4.43 megabytes/b/p
  /td
  td valign=topinput type=checkbox name=file[]
value=%28Metalica%29+-+Enter+Sandman.mp3
   input type=hidden name=filenumber[] value=986
  /td
 /tr
/tr
 tr
  td width=295 valign=top
   pb Metalica/b/p
  /td
  td width=195 valign=top
   pbThe Memory Remains/b
  /td
   td width = 195 valign = top
   bAbout 4.24 megabytes/b/p
  /td
  td valign=topinput type=checkbox name=file[]
value=%28Metalica%29+-+The+Memory+Remains.mp3
   input type=hidden name=filenumber[] value=2331
  /td
 /tr
/tr
 tr
  td width=295 valign=top
   pb Metallica/b/p
  /td
  td width=195 valign=top
   pbBattery/b
  /td
   td width = 195 valign = top
   bAbout 4.77 megabytes/b/p
  /td
  td valign=topinput type=checkbox name=file[]
value=%28Metallica%29+-+Battery.mp3
   input type=hidden name=filenumber[] value=2136
  /td
 /tr
/tr
/table
input type=submit name=submit value=submit
/form

the problem is this:
Array
(
[filenumber] = Array
(
[0] = 3437
[1] = 986
[2] = 2331
[3] = 2136
)

[file] = Array
(
[0] = %28Metalica%29+-+Enter+Sandman.mp3
[1] = %28Metallica%29+-+Battery.mp3
)

when I submit the form, I get the whole array of filenumber but only the
selected files. Is there a way that I could limit it so that I get only the
selected filenumbers and files, or should I re-think the way the script
works?

Thank you,
Mike


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] A small problem with input feilds.

2002-12-05 Thread Tim Ward
only checked checkboxes are submitted therefore you have to number
the form fields if you want to keep the relationship between the arrays
- this should be easy enough if the form is generated by your code.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Mike [EMAIL PROTECTED]
To: php mailinglist [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 5:59 PM
Subject: [PHP] A small problem with input feilds.


 Hello everyone,
 I have the following html code that is generated via a script:

 table
  form action=/new/mp3/stuff/testsearch.php method=post target=

 trtdbArtist/b/tdtdbTitle/b/tdtdbFile
 Size/b/tdtdCheck/td/tr
  tr
   td width=295 valign=top
pb Dj Ummet/b/p
   /td
   td width=195 valign=top
pbPump This Party (extended Mix)/b
   /td
td width = 195 valign = top
bAbout 4.5 megabytes/b/p
   /td
   td valign=topinput type=checkbox name=file[]
 value=%28Dj+Ummet%29+-+Pump+This+Party+%28Extended+Mix%29.mp3
input type=hidden name=filenumber[] value=3437
   /td
  /tr
 /tr
  tr
   td width=295 valign=top
pb Metalica/b/p
   /td
   td width=195 valign=top
pbEnter Sandman/b
   /td
td width = 195 valign = top
bAbout 4.43 megabytes/b/p
   /td
   td valign=topinput type=checkbox name=file[]
 value=%28Metalica%29+-+Enter+Sandman.mp3
input type=hidden name=filenumber[] value=986
   /td
  /tr
 /tr
  tr
   td width=295 valign=top
pb Metalica/b/p
   /td
   td width=195 valign=top
pbThe Memory Remains/b
   /td
td width = 195 valign = top
bAbout 4.24 megabytes/b/p
   /td
   td valign=topinput type=checkbox name=file[]
 value=%28Metalica%29+-+The+Memory+Remains.mp3
input type=hidden name=filenumber[] value=2331
   /td
  /tr
 /tr
  tr
   td width=295 valign=top
pb Metallica/b/p
   /td
   td width=195 valign=top
pbBattery/b
   /td
td width = 195 valign = top
bAbout 4.77 megabytes/b/p
   /td
   td valign=topinput type=checkbox name=file[]
 value=%28Metallica%29+-+Battery.mp3
input type=hidden name=filenumber[] value=2136
   /td
  /tr
 /tr
 /table
 input type=submit name=submit value=submit
 /form

 the problem is this:
 Array
 (
 [filenumber] = Array
 (
 [0] = 3437
 [1] = 986
 [2] = 2331
 [3] = 2136
 )

 [file] = Array
 (
 [0] = %28Metalica%29+-+Enter+Sandman.mp3
 [1] = %28Metallica%29+-+Battery.mp3
 )

 when I submit the form, I get the whole array of filenumber but only the
 selected files. Is there a way that I could limit it so that I get only
the
 selected filenumbers and files, or should I re-think the way the script
 works?

 Thank you,
 Mike


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php