HTTP_POST_VARS not picking up checkboxes that are unchecked

From: Date: Mon, 18 Jun 2001 23:46:46 +0000
Subject: HTTP_POST_VARS not picking up checkboxes that are unchecked
Groups: php.general 
Request: Send a blank email to php-general+get-54295@lists.php.net to get a copy of this message
I have a form with approximately 40 input fields. When a form is posted it sends an email and then builds a tab delimited $txt entry for a text file on the server. The problem is that if a checkbox is not checked, when it's not required, I don't get a blank entry in my tab file for the checkbox input. I'm imploding my HTTP_POST_VARS variable like so; reset($HTTP_POST_VARS); while (list($var, $value) = each($HTTP_POST_VARS)) { if (is_array($value)){ $txt .= implode($value, "\t"); $txt .= "\t"; } else{ $txt .= "$value\t"; } } $txt .= "end\n"; $flsfile = fopen("text/fls.txt", "a"); if ($flsfile){ fputs($flsfile, "$txt"); fclose($flsfile); } Is there a way to send a blank value if the checkbox is not set? Should I use a completely different strategy? Have I said Thank you enough to Rasmus Lerdorf and whomever else was involved in resuscitating the list? Thanks Rasmus Lerdorf and all others involved for getting the list back up and running. >>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>> Tom Beidler Orbit Tech Services 805.682.8972 (phone) 805.682.5833 (fax) tom@orbittechservices.com http://www.orbittechservices.com/ >>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>

« previous php.general (#54295) next »