Re: Re: order of elements in $_POST super global

From: Date: Thu, 08 Jun 2006 16:14:56 +0000
Subject: Re: Re: order of elements in $_POST super global
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-237639@lists.php.net to get a copy of this message
Hello João, You are right that the $_POST variable does not receive anything for unchecked boxes. I didn't realize that. But I still need the foreach loop for other reasons: So it looks like this: foreach ($_POST as $key => $data) { $query.="$key, "; } Instead of this: foreach ($_POST as $key => $data) { if ($data) $query.="$key, "; } Thanks, Ben On 6/8/06, João Cândido de Souza Neto <joao@curitibaonline.com.br> wrote:
Since i remember, when a for POST is sent and a checkbox is not checked, php not receive this $_POST variable. That is, i think you don´t need to use a foreach to know if checkbox was checked or not. Am i wrong?


« previous php.general (#237639) next »