RE: [PHP] array + checkbox

From: Date: Tue, 07 Aug 2001 15:25:56 +0000
Subject: RE: [PHP] array + checkbox
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61640@lists.php.net to get a copy of this message
try this: If( strcmp($voorraad[1],'on') == 0 ) // it's checked else // it's not Good luck, Ben -----Original Message----- From: Tijmen Hennink [mailto:tijmen@mediaconnect.nl] Sent: Monday, August 06, 2001 1:34 AM To: php-general@lists.php.net Subject: [PHP] array + checkbox Hi All, I've the following weird problem. I have a form which contains an array with values of some checkboxes. This is the HTML-part: <INPUT TYPE=checkbox name=voorraad checked> if checked or <INPUT TYPE=checkbox name=voorraad> Now I want to check which of the checkboxes are really checked. So I've got the following PHP code: if(count($voorraad[1])>0) { echo "VOORRAAD NEE"; } else { echo "VOORRAAD JA"; } I've tried it with isset($voorraad[1]), count, is_null($voorraad[1]) but all the functions doesn't work. Does anyone see what I'm doing wrong?? Met vriendelijke groet/with kind regards, Tijmen Hennink ------------------------------------------------------------------------ ---- tijmen@mediaconnect.nl Medi@connect ------------------------------------------------------------------------ ---- Dit e-mail bericht is uitsluitend bestemd voor de geadresseerde(n). Gebruik van deze informatie door andere dan de geadresseerde is verboden. Het is evenmin toegestaan om deze informatie openbaar te maken, te vermenigvuldigen, te verspreiden of te verstrekken aan derden. Aan dit bericht kunnen geen rechten worden ontleend. Indien u dit mailtje heeft ontvangen terwijl het niet aan u gericht was, reply richting mij en verwijder vervolgens de email en uitgeprinte versies van dit mailtje. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform me promptly by reply e-mail, then delete the e-mail and any printed copy. Thank you.

« previous php.general (#61640) next »