|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-08-11 23:25 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 16:00:02 2025 UTC |
The problem that I am having is that I have created an array of input elements on a form, and I have been having problems with the checkbox elements being passed appropriately. When I fill in the form entries, I expect the corresponding values to be populated, but when I select any of the checkboxes, for example, 1, 3, and 7... It always returns a Yes for 0,1, and 2. This causes problems when I'm deleting the user's pictures based on their selection. :) Configure line follows. --- './configure' '--with-mysql' '--with-apxs=/opt/apache-1.3.20/bin/apxs' '--with-pear' '--with-openssl' '--with-imap' '--with-imap-ssl' '--with-curl' '--with-gd' '--with-png-dir=/usr/lib' '--with-zlib-dir=/usr/lib' '--with-jpeg-dir=/usr/lib' '--with-ttf' '--enable-track-vars' '--with-pspell' '--enable-ftp' '--enable-memory-limit' '--enable-inline-optimization' '--disable-debug' '--enable-safe-mode' '--enable-magic-quotes' '--with-gettext' '--with-xml' --- A sample script follows. --- <?php if (isset($submit)) { for ($i=0; $i<26; $i++) { echo 'i='.$i.' Image line='.$img[$i].' Text line='.$txt[$i].' Delete line='.$dlt[$i].'<BR>'; } } else { // if (isset($submit)) ?> <FORM ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF ?>?id=<?php echo $id ?>" METHOD=POST> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000"> <TABLE CELLPADDING="3"> <?php for ($j=0; $j<26; $j++) { if ($j == 0) $imagedesc = 'Main Image'; else $imagedesc = 'Image #'.$j; echo '<TR><TD COLSPAN="2">'.$imagedesc.' <INPUT NAME="img[]" TYPE="file"> <INPUT TYPE="checkbox" NAME="dlt[]" VALUE="Yes"> Delete? </TD></TR>'; echo '<TR><TD>'.$image[$j].'</TD><TD><TEXTAREA NAME="txt[]" ROWS="6" COLS="30">'.$text[$j].'</TEXTAREA></TD></TR>'; } ?> </TABLE> <INPUT NAME="submit" TYPE="submit" VALUE="Send File(s)"> </FORM> <?php } // end of if isset($submit) ?> --- Hope you can help, -Tony