If I were you, I do this way.
// in your HTML form.
select name=flag
option value=1 Husband/option
...
/select
// DB
then insert 1, 2, 3, 4. //it will be one of them from flag variable.
// when you retrieve it...
if (flag == 1)
echo Husband
if ...
and so on. :)
Kang
Chan Hweefarn Saputra wrote:
hi :)
i am creating a webpage. i use a combo box to let user
choose which folder they want.
after they choose, it will be saved into the database.
the next time they load this page, it will retrieve
the data from database and appear at the combo box.
i already done that.
but now the problem isthe data that i retrieve
from the database will same with the options in the
combo box.
so, it will become 2 same options. i am afraid this
will confuse the user. so i want to fix it.
if u dont understand what i mean, try look at the
picture coding below:
folder: husband
friend
family
boss
husband
___
this is the code:
select size=1 name=groupMailbox1
option?php echo $row[groupMailbox1]; ?/option
?php
//Open Directory you want to include
//$base='/home/a/mail';
$handel = opendir($base);
//Get contents of the directory
while (false !== ($file =
readdir($handel))) {
if (is_dir($base . / .
$file) ($file !== .) ($file !== ..)) {
list($filename, $ext) =
explode(., $file);
list($main, $sub, $include) =
explode(/, $PHP_SELF);
echo option value=\$file\; //Echo
the file name in a combo box
if ($inc==$file) echo
selected;
echo$file/option\n;
echo $file;
}
}
?
/selectp/p
___
how to make it so that the data that we retrieve from
database, if same with the options we have, we only
need to make that option selected?
thanks :)
hweefarn
__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php