Form Processing Question - Empty Fields

From: Date: Wed, 23 May 2007 16:40:00 +0000
Subject: Form Processing Question - Empty Fields
Groups: php.general 
Request: Send a blank email to php-general+get-255428@lists.php.net to get a copy of this message
I have a script to process the post from a form. The form is used to upload photos and has fields for the filename, alt text, caption and a checkbox to indicate if this photo is the main page image rotation. I wanted to build a general routine to build the form to allow for a varying number of photos to upload. I use main_image[] for the various checkboxes for each photo. I see that the checkbox is *not* set, I get nothing back, and if the second photo is checked (and the first not checked), I get main_image[0] = 'on'. And I see this happens for the caption[] array as well. This seems to me to be pretty ugly. Am I understanding this properly? Do I really have to use main_image1, main_image2.... Thanks Stephen

« previous php.general (#255428) next »