php-windows Digest 3 Mar 2009 13:33:37 -0000 Issue 3583
Topics (messages 29197 through 29199):
Re: drop down menu to a table
29197 by: sam rumaizan
29198 by: Marien den Besten
29199 by: Dan Shirah
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
How do you specify the value of the option?
--- On Mon, 3/2/09, pte...@sensite.net <pte...@sensite.net> wrote:
From: pte...@sensite.net <pte...@sensite.net>
Subject: Re: [PHP-WIN] drop down menu to a table
To: samc...@yahoo.com, php-wind...@lists.php.net
Date: Monday, March 2, 2009, 6:38 PM
Include the drop down in a form with method=post and action=something.php
In something.php, write $_post['drop down name'] to the table.
Sent from my Verizon Wireless BlackBerry
-----Original Message-----
From: sam rumaizan <samc...@yahoo.com>
Date: Mon, 2 Mar 2009 17:27:32
To: <php-wind...@lists.php.net>
Subject: [PHP-WIN] drop down menu to a table
How do I insert data from a drop down menu values (select box) to a table
--- End Message ---
--- Begin Message ---
This will be you answer I guess
<option value="foo">bar</option>
-----Original Message-----
From: sam rumaizan [mailto:samc...@yahoo.com]
Sent: dinsdag 3 maart 2009 3:53
To: php-wind...@lists.php.net; pte...@sensite.net
Subject: Re: [PHP-WIN] drop down menu to a table
How do you specify the value of the option?
--- On Mon, 3/2/09, pte...@sensite.net <pte...@sensite.net> wrote:
From: pte...@sensite.net <pte...@sensite.net>
Subject: Re: [PHP-WIN] drop down menu to a table
To: samc...@yahoo.com, php-wind...@lists.php.net
Date: Monday, March 2, 2009, 6:38 PM
Include the drop down in a form with method=post and action=something.php
In something.php, write $_post['drop down name'] to the table.
Sent from my Verizon Wireless BlackBerry
-----Original Message-----
From: sam rumaizan <samc...@yahoo.com>
Date: Mon, 2 Mar 2009 17:27:32
To: <php-wind...@lists.php.net>
Subject: [PHP-WIN] drop down menu to a table
How do I insert data from a drop down menu values (select box) to a table
--- End Message ---
--- Begin Message ---
>
> How do you specify the value of the option?
>
Or if you are working with values from a database you could do something
simple like:
<SELECT name="name">
<?php
$q_name = "SELECT * from name_table";
$r_name = ifx_query($q_name, $connect_id) or die("couldn't execute the
query");
while ($rec_name = ifx_fetch_row($r_name)) $name[] = $rec_name;
echo "<OPTION value=\"\">--SELECT--</OPTION>\n";
foreach ($name as $n)
{
if ($n['full_name'] == $_POST['name'])
echo "<OPTION value=\"{$n['full_name']}\"
SELECTED>{$n['full_name']}</OPTION>\n";
else
echo "<OPTION
value=\"{$n['full_name']}\">{$n['full_name']}</OPTION>\n";
}
?>
</SELECT>
--- End Message ---