Re: making a tutorial

From: Date: Fri, 17 Mar 2006 07:11:31 +0000
Subject: Re: making a tutorial
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-232087@lists.php.net to get a copy of this message
Parse.. It will be an array after you submit the form. So depends on what you wanna do with it. Do a print_r($favourite); after form submit and you will see. How to store it.. well if you wanna it in seperate fields you can loop through it and do an insert on every array element in your DB or store it serialized. Or create a string from the array and store it in a DB field. enum? Don't think it will work :) grtz, Thijs > I'm making a tutorial and don't really understand how to do this myself :) > > <p>Which of the following pets do have at home: > <br /><input type="checkbox" name="favourite[]" > value="dog">dog > <br /><input type="checkbox" name="favourite[]" > value="cat">cat > <br /><input type="checkbox" name="favourite[]" > value="snake">snake > <br /><input type="checkbox" name="favourite[]" > value="other">snake > <br /><input type="checkbox" name="favourite[]" > value="none">none of these > </p> > > How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0] > - nMax. It is a checkbox. > > I might use favourite[] with mail() or store it in a mysql field. > > If mysql, would I store it in a varchar(20) or an enum() and how? > > John > >

« previous php.general (#232087) next »