Current location: Hot Scripts Forums » Programming Languages » PHP » Need help with populating drop down menu...


Need help with populating drop down menu...

Reply
  #1 (permalink)  
Old 04-28-04, 07:10 AM
NCC1701's Avatar
NCC1701 NCC1701 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Need help with populating drop down menu...

Im trying to have separate functions for displaying forms and the actual logic, this is the form display with the drop down menu:

output_fns.php
PHP Code:

<?php
};
function 
display_menu_form($menu_name)
{
?>
  <form method="post" action="menu.php">
  <table align="center" border="0">
  <tr>
    <td>
 <select name="menu_name">
 <option value="<?php echo $HTTP_POST_VARS['menu_name']; ?>"></option>
 </select>
 </td>
  </tr>
  <td><input name="Submit" type="button" value="Submit"></td>
  </tr>
  </table>
  </form>
<?php 
}
?>
and this is the logic that is supposed to populate the form:
PHP Code:

<?php
 
require_once('tannin_level.php');
 
session_start();
 
do_html_header('Select Menu to Edit');
 
 
//create short variable names
 
$menu_id $HTTP_POST_VARS['menu_id'];
 
$menu_name $HTTP_POST_VARS['menu_name'];
 
$menu_text $HTTP_POST_VARS['menu_text'];
 
 
// create connection 
    
$conn db_connect();
    if (!
$conn)
    return 
false;
    
// create SQL statement 
    
$query "SELECT menu_id, menu_name, menu_text 
           FROM menu"
;
     
// execute SQL query and get result 
    
$result mysql_query($query,$conn);
 
 
// format results by row
    
while ($row mysql_fetch_array($result)) 
 { 
    
$menu_name $row['menu_name']; 
    }
 
 
display_menu_form($menu_name);
 
display_user_menu();
 
do_html_footer();
?>
i get no errors but the menu is not populated and i dont know where im going wring, can anyone assist?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a drop down menu ? ? ? Spreegem PHP 4 03-09-05 09:34 AM
Creating a drop down menu? Spreegem HTML/XHTML/XML 8 08-30-04 11:40 PM
Replacing drop down form menu with fixed value NCC1701 PHP 1 04-05-04 02:47 PM
drop down menu problem !!! nurqeen PHP 1 02-08-04 08:07 PM
putting content in a drop down menu tom PHP 7 07-04-03 02:25 PM


All times are GMT -5. The time now is 10:30 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.