我想使用 PHP 和 AJAX 为我的网站创建一个菜单编辑器

发布于 2024-09-18 12:58:07 字数 219 浏览 4 评论 0原文

我创建了 menu.php,它从 MySQL 数据库加载菜单项,通过一个函数解析它们,该函数为菜单项创建代码,然后按顺序显示在 HTML 列表中(告诉我这是否令人困惑,我可以发布代码)。我想做的是一个管理页面,允许用户对菜单项重新排序,顺便说一句,它们是按顺序列排序的。

提前致谢:)

编辑:我遇到的主要问题是创建用户界面,用户可以在其中移动菜单项(希望是拖放),然后将新订单保存到数据库中。

I created menu.php which loads the menu items from a MySQL database, parses them through a function which creates the code for the menu items which are then displayed in order in an HTML list (tell me if this is confusing and I can post the code). What I would like to make is an admin page the would allow the user to reorder the menu items, BTW they are sorted by an order column.

thanks in advance :)

edit: The main part where I'm stuck is creating the user interface where the user can shift the menu items around (hopefully drag and drop) and then saving the new order to the database.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薔薇婲 2024-09-25 12:58:08

我认为这就是您正在寻找的:

http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php -mysql/

它使用jquery可排序插件。

I think this is what you are searching for :

http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php-mysql/

It uses the jquery sortable plugin.

维持三分热 2024-09-25 12:58:08

我将从 jQuery UI 可排序小部件开始:

http://jqueryui.com/demos/sortable/

I would start out with the jQuery UI sortable widget:

http://jqueryui.com/demos/sortable/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文