RE: [PHP] Select List PHP,HTML
| From: | Jay Blanchard | Date: | Mon, 23 Aug 2004 19:23:16 +0000 |
| Subject: | RE: [PHP] Select List PHP,HTML | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-194516@lists.php.net to get a copy of this message | ||
[snip]
I have been able to create a list with no problem, but now I need to get
the
value of which item is selected in the list. I looked around, but
couldn't
find anywhere that would let me do this.
Here's my code to build the list.
<SELECT name="Company List" multiple size="8">
<?php
$db = new COM("ADODB.Connection");
$dsn = "DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
DATABASE=BINDER";
$db->Open($dsn);
$rs = $db->Execute("SELECT * from company");
while (!$rs->EOF)
{
$Name = $rs->Fields['Name']->Value;
print "<OPTION>".$Name;
$rs->MoveNext();
}
?>
</Select>
I would appreciate any help I could get with this.
[/snip]
echo $_POST['Company List'];