我正在编写一个博客编辑器,它在POST请求到达页面时加载,比如blog_editor.php。发布请求数据看起来像blog_title =“这是博客标题”修改刷新/事件页面请求
现在blog_editor.php从发布请求中读取博客标题(如果存在),则从数据库读取blog_id,并且内容已准备好进行编辑,否则将发布新的数据库条目已创建。
现在我已经给出了应该使用ajax保存的blog_title的内联编辑选项。
My problem here is, the page is looking for a unique blog_title. If user modifies the blog title inline and then does a page refresh, it creates a new blog with old blog_title as POST request still contains old title.
可我好歹修改这篇文章的数据?
为什么不直接发送'blog_id'?这不会改变... – Indranil 2011-12-20 03:10:00
用户是否有刷新页面的原因?人们会希望他们的数据在硬刷新时丢失。 – 2011-12-20 03:14:41
我同意......一旦到达目标页面,您通常无法更改POST数据。你最好做一些检查,看帖子ID是-1(比如说一个新的博客文章)还是101(对于一个现有的帖子),然后根据这个进行操作。 – 2011-12-20 03:16:08