php 控制页面跳转
<?php
class UserAction extends Action{
public function index(){
echo "你好!";
$m=M('user');
$arr=$m->select();
#var_dump($arr);
$this->assign('data',$arr);
$this->display(); } public function del(){
$m=M('user');
##删除具体id数据
$id=$_GET['id'];
$count=$m->delete($id);
echo $count;
if ($count>0){
$this->success('数据删除成功');
}else{
$this->error('数据删除失败');
}
}
//负责修改页面
public function modify(){
$id=$_GET['id'];
$m=M('user');
$arr=$m->find($id);
$this->assign('data',$arr);
$this->display();
} public function update(){ $m=M('user');
$data['id']=$_POST['id'];
$data['username']=$_POST['username'];
$data['sex']=$_POST['sex'];
$count=$m->save($data);
if ($count>0){
$this->success('数据修改成功','index');
}else{
$this->error('数据修改失败');
} } public function add(){ $this->display();
} public function create(){
$m=M('user');
$m->id=$_POST['id'];
$m->username=$_POST['username'];
$m->sex=$_POST['sex'];
$idnum=$count=$m->add();
if ($idnum){
$this->success('数据添加成功','index');
}else{
$this->error('数据添加失败');
}
$this->display();
} } ?> public function create(){
$m=M('user');
$m->id=$_POST['id'];
$m->username=$_POST['username'];
$m->sex=$_POST['sex'];
$idnum=$count=$m->add();
if ($idnum){
$this->success('数据添加成功','index');
}else{
$this->error('数据添加失败');
}
$this->display(); 数据添加成功调整到/User/index.html 页面 如果 $this->success('数据添加成功'); 添加成功后悔停留在当前页面 页面跳转有后台方法控制
php 控制页面跳转的更多相关文章
- js 控制页面跳转的5种方法
js 控制页面跳转的5种方法 编程式导航: 点击跳转路由,称编程式导航,用js编写代码跳转. History是bom中的 History.back是回退一页 Histiory.go(1)前进一页 Hi ...
- Jsp页面跳转和js控制页面跳转的几种方法
Jsp 页面跳转的几种方法 1. RequestDispatcher.forward() 在服务器端起作用,当使用forward()时,Servlet engine传递HTTP请求从当前的Servle ...
- js控制页面跳转,清缓存,强制刷新页面
单看标题,必定满脸蒙13. 其实,想表达的仅仅是,在js中通过window.location.href控制页面跳转时,有时会跳转至缓存页面,并没有真正去请求要跳转的地址,导致页面数据未能及时加载刷新. ...
- vue滚动行为控制——页面跳转返回上一个页面保留滚动位置
需求分析: 一般这个功能在后台管理系统用的比较多,因为后台页面都是在当前页面打开,对于某些列表筛选页,如果列表数据比较多,页面就会滚动.当页面发生滚动,对列表数据进行查看或者编辑的时候,跳转到下一级页 ...
- ajax控制页面跳转
一开始我是这么写的,一直报错,跳转路径解析不了,显示为问号: 前台html: <form> <table style="margin: 200px auto;"& ...
- Vue 实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案
Vue实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案 by:授客 QQ:1033553122 开发环境 Win 10 Vue 2.9.6 node-v ...
- javascript控制页面(含iframe进行页面跳转)跳转、刷新的方法汇总
一.JS方式的页面跳转1.window.location.href方式 <script language="JavaScript" type="text/ja ...
- web设计页面跳转的方法
一.asp.net c# 打开新页面或页面跳转 1. 最常用的页面跳转(原窗口被替代):Response.Redirect("newpage.aspx"); 2. 利用url地址打 ...
- jquerymobile页面跳转和参数传递
http://blog.csdn.net/chen052210123/article/details/7481578 页面跳转: 页面跳转时pagebeforechange事件会被触发两次,通过$(d ...
随机推荐
- CentOS用yum安装搭建LAMP
#1.安装Apache yum install httpd httpd-devel #启动apache /etc/init.d/httpd start #设为开机启动: chkconfig httpd ...
- Best Component for Bitmap Image
The best is to purchase ImageEn and use the latest version. Coz nothing compares to ImageEn.... But ...
- docker学习笔记13:Dockerfile 指令 WORKDIR介绍
Dockerfile中的WORKDIR指令用于指定容器的一个目录, 容器启动时执行的命令会在该目录下执行. 相当于设置容器的工作目录了.我们来看一个dockerfile文件 #test FROM ub ...
- 无线网络wifi (WPA/WPA2)密码破解方法
无线网络password破解WPA/WPA2教程 本教程用于探索无线路由安全漏洞,禁止用于非法用途,违者法律必究(与我无关) 在动手破解WPA/WPA2前,应该先了解一下基础知识,本文适合新手阅读 首 ...
- Java字符串排序中文+数字
编写日期: 2013年9月15日 另一中解法:点击查看 解决思路: 在Java中,排序需要复写的是 equals 方法 和 Comparable<T> 接口 的public int com ...
- UVA1452|LA4727-----Jump------经典的约瑟夫公式的变形(DP)
本文出自:http://blog.csdn.net/dr5459 题目地址: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&a ...
- linux BC命令行计算器
1. 基本使用: $ bc <<< 5*4 20 $ bc <<< 5+4 9 $ bc <<< 5-4 1 或者 $ echo "5* ...
- 使用gson(一)
1.数组和json的转换 package com.test.gson; import com.google.gson.Gson; public class ArrayToJson { public s ...
- HDOJ 3047 带权并查集
解题思路转自: http://blog.csdn.net/azheng51714/article/details/8500459 http://blog.csdn.net/acresume/artic ...
- Hibernate 3中如何获得库表所有字段的名称
15问:Hibernate 3中如何获得库表所有字段的名称 答:可以使用以下的程序获得. Configuration conf = new Configuration(); conf.configur ...