Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个使用 php 和 js 的服务器驱动站点。一个部分显示我们的用户上传的所有照片,然后管理员决定保留哪些照片以供最终演示。大多数网站都使用 jquery 进行就地编辑,但这个任务让我很难过。我想在 MySQL 数据库表中插入一行,单击复选框 ...NO SUBMIT 按钮复制照片的 URL 和其他相关信息。
我在 foreach (glob($dir)) 中生成了我需要的所有信息,并且在生成的每张照片旁边我可以放置复选框。
$('checkbox selectors here').bind('click', function() { $.ajax({ type: 'POST', url: url/to/backend.page, data: {dictionary of data}, etc etc }); );
在后端页面,只需处理 POST 请求并插入适当的 MySQL 记录。