Re: Newbie HTML-form & PHP question

From: Date: Sat, 23 Sep 2000 08:21:05 +0000
Subject: Re: Newbie HTML-form & PHP question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17571@lists.php.net to get a copy of this message
Let's say the HTML for your radio buttons looks like this: <Input type=radio name=gender value=female>Female <Input type=radio name=gender value=male>Male Now you have a variable available to your script called $gender. You can work the code like this: if ($gender == "female") // do something for a female user else if ($gender == "male") // do something for a male user else // on gender was selected Hope that helps. ----- Original Message ----- From: Bart A. Verbeek <bodemschat@home.nl> To: Php-General-list <php-general@lists.php.net> Sent: Wednesday, September 20, 2000 8:08 AM Subject: [PHP] Newbie HTML-form & PHP question > Hello, > I'm creating a form that will allow users to subscribe thereselves to a > database-mailinglist. > now I've got one question: > > How does PHP handle radiobuttons. I want to let the visitor decide If there > [male] or [female] and than store the decided entry in the database. Is it > possible to writre the script so that [male]=1 and [female]=0 (or 'Y' & 'N') > and than store the entry? > > I don't know how to. maybe all you can help. > > regards > bart > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#17571) next »