Re: array question

From: Date: Thu, 30 May 2002 23:21:29 +0000
Subject: Re: array question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100020@lists.php.net to get a copy of this message
On Thu, May 30, 2002 at 07:24:49PM -0400, Michelle wrote: > <p>Phone Number:<br /> > <INPUT type=\"text\" name=\"phone\" value=\"$_POST[phone]\" > size=30></p> > > which finally leads to my question how do I do the $_POST[var] when > it's an array(checkbox or radio button)? > > ex: <input type=\"checkbox\" name=\"product[]\" > value=\"red\">red<br /> echo '<input type="checkbox" name="product[]" value="red"'; echo ( in_array('red', $_POST['product']) ) ? ' checked' : '' ; echo ' />red'; --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

« previous php.general (#100020) next »