提交之后会显示织梦的默认提示信息“友情提示”几秒过后就自动转到首页。如何才能让提交的信息停留,并让用户确认所提交的信息。
我想了如下方式。给diyphp里提交成功后输入固定值而不是自带的跳转方法。如下:
if($action == 'post')
{
if(empty($do))
{
$postform = $diy->getForm(true);
include DEDEROOT"/templets/plus/{$diy->postTemplate}";
exit();
}
elseif($do == 2)
{
$dede_fields = empty($dede_fields) '' : trim($dede_fields);
$dede_fieldshash = empty($dede_fieldshash) '' : trim($dede_fieldshash);
if(!empty($dede_fields))
{
if($dede_fieldshash != md5($dede_fields$cfg_cookie_encode))
{
showMsg('数据校验不对,程序返回', '-1');
exit();
}
}
$diyform = $dsql->getOne("select from osen_diyforms where diyid='$diyid' ");
if(!is_array($diyform))
{
showmsg('自定义表单不存在', '-1');
exit();
}
$addvar = $addvalue = '';
if(!empty($dede_fields))
{
$fieldarr = explode(';', $dede_fields);
if(is_array($fieldarr))
{
foreach($fieldarr as $field)
{
if($field == '') continue;
$fieldinfo = explode(',', $field);
if($fieldinfo[1] == 'textdata')
{
${$fieldinfo[0]} = FilterSearch(stripslashes(${$fieldinfo[0]}));
${$fieldinfo[0]} = addslashes(${$fieldinfo[0]});
}
else
{
${$fieldinfo[0]} = GetFieldValue(${$fieldinfo[0]}, $fieldinfo[1],0,'add','','diy', $fieldinfo[0]);
}
$addvar = ', `'$fieldinfo[0]'`';
$addvalue = ", '"${$fieldinfo[0]}"'";
}
}
}
$query = "insert into `{$diy->table}` (`id`, `ifcheck` $addvar) values (NULL, 0 $addvalue); ";
if($dsql->executenonequery($query))
{
$id = $dsql->GetLastID();
if($diy->public == 2)
{
//diyphpaction=view&diyid={$diy->diyid}&id=$id
$goto = "diyphpaction=list&diyid={$diy->diyid}";
$bkmsg = '发布成功,现在转向表单列表页';
}
else
{
$goto = !empty($cfg_cmspath) $cfg_cmspath : '/';
$bkmsg = '发布成功,请等待管理员处理';
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" ">{dede:loop table='dede_diyform1' sort='id' row='5' if=''}
[field:uname/]
{/dede:loop}
上面就是调用自定义表单的标签。
其中:dede_diyform1是自定义表单的名称,sort='id'是调用方式, row调用条数。if调用条件
[field:uname/] 为自定义表单的字段名称1:织梦自定义表单跳转速度太快,如何调整让客户提交表单后跳转速度变成20秒例子: >
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)