0

我想提供一个可以创建帖子并在表单提交后立即为新创建的帖子加载编辑页面的表单。要加载编辑页面,我需要正确的post_id.

提交表单时,帖子由表单处理程序在编辑页面的脚本中创建:

if(isset($_POST['create']){
  $post_id = create_new_post($args);
}else{
  $post_id = isset($_Request['post_id'])? $_Request['post_id'] :null;
}
if($post_id)
 load_editor($post_id);

上面的代码可以在表单提交时加载编辑器。但是新创建的帖子()的编辑器页面 URLeditor.php?action=edit)与现有帖子的编辑器页面不同(editor.php?post_id=123&action=edit)。如何获取 post_id 并将其添加到查询字符串中?

4

0 回答 0