I want to add and remove items from a menu with PHP.
Posted
by CDeanMartin
on Stack Overflow
See other posts from Stack Overflow
or by CDeanMartin
Published on 2010-06-16T11:38:07Z
Indexed on
2010/06/16
11:42 UTC
Read the original article
Hit count: 190
This menu will need to be updated daily.
<html><head></head><body>
<h1> Welcome to Burgerama </h1>
<?php include("menuBuilder.php");
showBurgerMenu();
?>
</body></html>
Menu items are stored in the database. Items have a display field; if it is on, the item should be displayed on the menu. The menu only displays 4 or 5 "specials" at a time, and the manager needs to change menu items easily. I want to make a menu editing page like this:
<?php include("burger_queries.php");
dbconnect("burger_database");
foreach($menuItem in burger_database)
{
echo createToggleButton($menuItem);
}
?>
.. with a toggle button for each menu item. Ideally the button will be labeled with the menu item, in blue if the item is "on", and red if the item is "off." Clicking the button switches between "on" and "off"
I am stuck trying to a get a button to execute an UPDATE query on its corresponding menu item.
© Stack Overflow or respective owner