Home >CMS Tutorial >DEDECMS >How to modify the jump link after DEDECMS custom form submission

How to modify the jump link after DEDECMS custom form submission

藏色散人
藏色散人Original
2019-12-17 10:26:571817browse

How to modify the jump link after DEDECMS custom form submission

The example in this article describes how to modify the jump link after submitting the DEDECMS custom form. Share it with everyone for your reference. The specific implementation method is as follows:

Recommended learning: 梦Weavercms

dedecms custom form, after clicking submit, it will jump to the homepage by default, and we open plus/diy. php, there is such a piece of code:

The code is as follows:

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); 
}

Find this line:

The code is as follows:

$goto = !empty($cfg_cmspath) ? $cfg_cmspath : '/';

jumps to the homepage That makes sense. Let's modify it, for example:

$goto = "/abc.htm"

can jump to the page you want. If you want to jump to the current page:

The code is as follows:

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);

The above is the detailed content of How to modify the jump link after DEDECMS custom form submission. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn