首先是控制器中,可以使用下代码: config配置如下: 'TMPL_ACTION_ERROR' => 'Public:error', // 默认错误跳转对应的模板文件 'TMPL_ACTION_SUCCESS' => 'Public:success' , // 默认成功跳转对应的模板文件success.html 页面 位置:Tpl\default\Public\success.html
<{$msgTitle}>
<{$message}>
<{$error}>
系统将在 <{$waitSecond}> 秒后自动跳转,如果浏览器无法跳转,直接点击 这里 跳转
error页面 位置:Tpl\default\Public\success.html
<{$msgTitle}>
<{$message}>
<{$error}>
系统将在 <{$waitSecond}> 秒后自动跳转,如果浏览器无法跳转,直接点击 这里 跳转

在控制器中调用

第1个参数代表输出信息,第2个参数代表跳转路径  第3个参数是几秒后跳转

效果图

success.html代码

 {__NOLAYOUT__}
<style type="text/css">
*{margin:;padding:;}
html,body{ overflow:hidden}
body{color:#;font:12px/1.5 Tahoma,Arial,"宋体",Helvetica,sans-serif;height:auto;width:%; background-color:#f9f9f9}
div{margin: auto;}
ul{list-style-type:none;}
.box{ border:5px solid #eee; width:480px; background-color:#fff;
margin-top:%;erflow:hidden;
}
.box-b{ border:1px solid #dfdbdb;width:478px;erflow:hidden;}
.box-title{ background:#549bd9;height:30px;line-height:33px;_line-height:30px;font-size: 14px;color:#fff; padding: 10px;}
.box-text{font:12px/1.5 "微软雅黑",Arial,"宋体",Helvetica,sans-serif; font-size:18px;color:#73787b;width:438px;
text-align:center; border:0px solid #; padding:20px; height:auto;word-wrap:break-word;
}
.box-button{overflow:hidden; text-align:right;}
.box-button a{ display: inline-block;
height:25px;line-height:23px;_line-height:25px;
text-align: center;
font-family:"微软雅黑";
font-size: 14px;
text-decoration: none;
padding:0px 5px;
margin:0px 10px; }
.a-{ background-color:#eee; color:#; border:1px solid #dfdbdb;}
.a-{ background-color:#eee; color:#;border:1px solid #dfdbdb;}
</style>
<script> function locahost(){
if("{$jumpUrl}"){
location.href="{$jumpUrl}";
}else{
window.history.back();
}
} function closeWindow(){window.open('', '_self', '');window.close();} var i = "{$waitSecond}"; if(i!=){window.close_id = setInterval(function() {if (i > ) {document.getElementById('time').innerHTML = i;i = i - ;} else {
locahost();clearInterval(window.close_id);}}, );}</script> <div class="box">
<div class="box-b">
<div class="box-title">消息提示</div>
<div class="box-text">
{$message}
</div>
<div class="box-button"><a class="a-2" href="javascript:;" onclick="locahost()"><font id="time" style="color:red;">{$waitSecond}</font>秒后跳转到下一个页面</a><a class="a-1" href="{:U('Index/index')}">返回前台首页</a></div>
<div style="height:10px; overflow:hidden; width:100%; clear:both"></div>
</div>
</div> </body>
</html>

ThinkPHP页面跳转success与error方法的更多相关文章

  1. 【转】ThinkPHP 页面跳转

    ThinkPHP 提供了success 与error 方法用于带提示信息的页面跳转,如添加数据后显示提示信息并跳转等.success 方法用于操作成功后的提示,error 用于操作失败后的提示,二者使 ...

  2. ThinkPHP页面跳转、Ajax技巧详细介绍(十八)

    原文:ThinkPHP页面跳转.Ajax技巧详细介绍(十八) ThinkPHP页面跳转.Ajax技巧详细介绍 一.页面跳转 $this->success('查询成功',U('User/test' ...

  3. 实现网页页面跳转的几种方法(meta标签、js实现、php实现)

    1.meta标签实现 只需在head里加上下面这一句就行了,在当前页面停留0.1秒后跳转到目标页面  代码如下 复制代码 1 <meta http-equiv="refresh&quo ...

  4. js 控制页面跳转的5种方法

    js 控制页面跳转的5种方法 编程式导航: 点击跳转路由,称编程式导航,用js编写代码跳转. History是bom中的 History.back是回退一页 Histiory.go(1)前进一页 Hi ...

  5. Jsp页面跳转和js控制页面跳转的几种方法

    Jsp 页面跳转的几种方法 1. RequestDispatcher.forward() 在服务器端起作用,当使用forward()时,Servlet engine传递HTTP请求从当前的Servle ...

  6. HTML 页面跳转的五种方法

    H方法TML 页面跳转的五种方法 下面列了五个例子来详细说明,这几个例子的主要功能是:在5秒后,自动跳转到同目录下的hello.html(根据自己需要自行修改)文件.1) html的实现 <he ...

  7. 实现网页页面跳转的几种方法大全(meta标签、js实现、php实现)

    1.meta标签实现 只需在head里加上下面这一句就行了,在当前页面停留0.1秒后跳转到目标页面  代码如下 复制代码 1 <meta http-equiv="refresh&quo ...

  8. ASP.NET页面跳转的三种方法比较

    在ASP.NET下,经常需要在页面之间跳转,下面我们来分别介绍一下关于.NET中Response.Redirect(),Sever.Execute(),Server.Transfer() 三种页面跳转 ...

  9. jquery/js/a标签实现当前页面跳转的两种方法

    在逛购物网站首页时经常看到侧边导航栏,当我们点击导航栏中某一项时会跳转到当前页面的某一处 有两种方法实现,一种是利用js计算好各位置的高度,通过绑定事件使页面跳转到指定位置,另一种是利用a标签进行当前 ...

随机推荐

  1. python学习第41天

    # 索引 # 认识mysql中的key # index key 普通索引,能够加速查询,辅助索引 # unique key 唯一 + 索引,辅助索引 # primary key 唯一 + 非空 + 聚 ...

  2. 【原创】大数据基础之Benchmark(4)TPC-DS测试结果(hive/hive on spark/spark sql/impala/presto)

    1 测试集群 内存:256GCPU:32Core (Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz)Disk(系统盘):300GDisk(数据盘):1.5T*1 2 ...

  3. 2)实现github自动登陆获取信息

    # -*- coding:utf-8 -*- # __author__ = 'lixiang' # 实现github自动登陆和获取数据 import requests from bs4 import ...

  4. SwipeRefreshLayout详解和自定义上拉加载更多

    个人主页 演示Demo下载 本文重点介绍了SwipeRefreshLayout的使用和自定View继承SwipeRefreshLayout添加上拉加载更多的功能. 介绍之前,先来看一下SwipeRef ...

  5. vscode 配置php

    vscode 的官网:https://code.visualstudio.com/docs/languages/php 添加扩张程序: php的设置: php格式化是安装“PHP Intelephen ...

  6. /etc/rc.d/init.d/iptables: No such file or directory 错误原因

    注:本文转载自cnblogs:一天学点的文章</etc/rc.d/init.d/iptables: No such file or directory 错误原因> RedHat Enter ...

  7. Confluence 6 CSS 编辑快速入门

    希望编辑空间的 CSS 样式表: 进入空间后,然后从边栏的底部选择 空间工具(Space tools) > 外观和感觉(Look and Feel) . 然后选择 样式表(Stylesheet) ...

  8. SpringBoot定时任务

    代码做定时任务:1.开个线程,线程里面休眠去做 2.使用一些定时任务的框架去做 1.创建TimerTest类 package com.cppdy.service; import org.springf ...

  9. J2SE基础小结

    1. 九种基本数据类型的大小,以及他们的封装类. 类型 基本类型 大小(字节) 默认值 封装类 整数型 byte 1 (byte)0 Byte short 2 (short)0 Short int 4 ...

  10. 对于stark(curd)插件的使用简单介绍

    一.创建表 from django.db import models from django.db import models class Department(models.Model): &quo ...