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:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
How do you specify the value of the option?



--- On Mon, 3/2/09, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: [PHP-WIN] drop down menu to a table
To: [email protected], [email protected]
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 <[email protected]>

Date: Mon, 2 Mar 2009 17:27:32 
To: <[email protected]>
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:[email protected]] 
Sent: dinsdag 3 maart 2009 3:53
To: [email protected]; [email protected]
Subject: Re: [PHP-WIN] drop down menu to a table

How do you specify the value of the option?



--- On Mon, 3/2/09, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: [PHP-WIN] drop down menu to a table
To: [email protected], [email protected]
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 <[email protected]>

Date: Mon, 2 Mar 2009 17:27:32 
To: <[email protected]>
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 ---

Reply via email to