织梦dedecms自定义表单点击提交后,直接跳转到表单列表页,如何实现跳转到上一页呢???
我们可以将自带的表单模板修改成我们需要的精美样式,路径是/templets/.../plus/post_diyform.htm修改时应该修稿相应的值:
<form method="post" enctype="multipart/form-data" action="/plus/diy.php" onsubmit="return checkpost();" name="myform" >
<input type="hidden" name="action" value="post" />
<input type="hidden" name="diyid" value="1" />
<input type="hidden" name="do" value="2" />
<input type="hidden" name="dede_fields" value="name,text;tel,textchar;message,multitext;yydate,textchar" />
<input type="hidden" name="dede_fieldshash" value="ffb12dc337564ab8f0405b8147cf49b7" />
...
另外。如果是在首页或者其他页面使用iframe调用的这时我们需要设置发布成功后跳转的页面,这个需要在/plus/diy.php中修改:
if($dsql->ExecuteNoneQuery($query))
{
$id = $dsql->GetLastID();
if($diy->public == 2)
{
//diy.php?action=view&diyid={$diy->diyid}&id=$id
$goto = "diy.php?action=list&diyid={$diy->diyid}";
}
else
{
$goto = !empty($cfg_cmspath) ? $cfg_cmspath : '/plus/diy.php?action=post&diyid=1';
$bkmsg = '发布成功,请等待管理员处理...';
}
showmsg($bkmsg, $goto);
}