dedecms自定义表单,点击提交后,默认跳转到首页,我们打开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}";
$bkmsg = '发布成功,现在转向表单列表页…';
}
else
{
$goto = !emptyempty($cfg_cmspath) ? $cfg_cmspath : '/';
$bkmsg = '发布成功,请等待管理员处理…';
}
showmsg($bkmsg, $goto);
}
找到这一行:
$goto = !empty($cfg_cmspath) ? $cfg_cmspath : '/';
就是跳转到首页的意思了。我们修改一下,比如:
$goto = “/abc.htm”
就可以跳转到你想要的页面了,如果想跳转到当前页面的话:
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}";
$bkmsg = '发布成功,现在转向表单列表页…';
echo "";
}
else
{
$goto = !emptyempty($cfg_cmspath) ? $cfg_cmspath : '/';
$bkmsg = '发布成功,请等待管理员处理…';
}
showmsg($bkmsg, $goto);
|