php 跳转控制
来源:互联网 发布:淘宝上的shockabsorber 编辑:程序博客网 时间:2024/06/07 04:58
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus?"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <script> function jump(){ window.location="http://localhost:8080/thinkphp/index.php/User/add"; } </script> </head> <body> <h1>scan show 你好 hhhello world</h1> <table border='1' width='500' align='center'> <tr> <th>id</th> <th>username</th> <th>sex</th> <th>操作</th> </tr> <volist name='data' id='vo'> <tr> <td><{$vo.id}></td> <td><{$vo.username}></td> <td><{$vo.sex}></td> <td><a href="http://localhost:8080/thinkphp/index.php/User/del/id/<{$vo.id}>">删除</a>|<a href="http://localhost:8080/thinkphp/index.php/User/modify/id/<{$vo.id}>">修改</a></td> </tr> </volist> </table> <center> <button onclick="jump()">添加用户</button> </center> </body></html>添加用户按钮,调用 window.location="http://localhost:8080/thinkphp/index.php/User/add"; public function add(){ $this->display(); } 跳转到一个增加用户的页面 <!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus?"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> </head> <body> <form action="__URL__/create" method='post'> id:<input type='text' name='id' /></br> 姓名:<input type="text" name='username' /></br> 性别:男<input type='radio' name='sex' value='1' > 女<input type='radio' name='sex' value='0'></br> <input type="submit" value='添加用户'/></br> </form> </body></html>add.html 里调用__URL__/create 方法: 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'); #$this->success('数据添加成功'); }else{ $this->error('数据添加失败'); } }
0 0
- php 控制页面跳转
- php 跳转控制
- php中后台方法控制页面跳转
- php跳转
- php跳转
- struts跳转控制笔记
- Java跳转控制语句
- JavaScript控制页面跳转
- android跳转流程控制
- JQuery控制跳转
- js 控制页面跳转
- 控制跳转语句
- 跳转控制语句(break)
- controller控制页面跳转
- 跳转控制语句
- js控制页面跳转
- 006、跳转控制语句
- 控制跳转语句
- [bzoj1172]Dream
- 3-7[attribute=value]属性选择器
- 2014.12.31 GY-291陀螺仪(ADXL345)串口输出字符形式加速度
- linux 下编程指令
- kmeans++
- php 跳转控制
- 数据结构复习之图(3)
- [从头读历史] 第281节 始制文字 世界上的语系及语言
- hdu 1394 Minimum Inversion Number(树状数组求逆序数)
- Picasso高逼格使用技巧
- 3-8[attribute!=value]属性选择器
- Linux开发工具之gcc
- Linux shell入门基础(八)
- GenyMotion不能启动的问题,Unable to start the virtual device.VirtualBox cannot start the virtual device