RE: [PHP] using html select as array

From: Date: Thu, 25 Apr 2002 18:36:03 +0000
Subject: RE: [PHP] using html select as array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94619@lists.php.net to get a copy of this message
Dame thing, no? Your <SELECT name="language[]">. You can see all those selected as an array. Now, add the text type and call it something different (ie; custom_lang). In the page, <? If(strlen($_GET['custom_lang'])) { // do insert of this } else { // loop the $_GET['Language'] and create your select. } Alternatively, you can ALWYS do this second condition, just override about the language[] if custom_lang is set. If(strlen($_GET['custom_lang'])) { ($_GET['Language'] = Array($_GET['custom_lang']); } // loop the language[] and create your select. ?> Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins > -----Original Message----- > From: Rodrigo Peres [mailto:rperes@mac.com] > Sent: Thursday, April 25, 2002 8:22 PM > To: php-general@lists.php.net > Subject: [PHP] using html select as array > > Hi list, > > In my system I have multiples choices of language that user selects > using drop down menus. So I've named this dropdows language[] and grab > it as php array, and with looo i insert it into mysql as registers. But > now i need to put a text field that the user can type any language that > is not in the dropdown. my question is how can i know when this was > typed when i do the select to update the user itens. I mean, when i > select and populate your preferences to update, how can i know that this > info is from the input text??? > > > Thank's > > Rodrigo > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#94619) next »