<!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('数据添加失败'); } }
网站首页 > gitee 正文
- 上一篇: 本章介绍HTML5 拥有若干涉及表单的元素和属性
- 下一篇: 用ASP进行网络打印功能
猜你喜欢
- 2024-04-19 个人简历
- 2024-04-19 Struts2标签大全
- 2024-04-19 struts标签
- 2024-04-19 struts2标签
- 2024-04-19 Struts2框架之-Struts2的标签
- 2024-04-19 struts2.0标签库
- 2024-04-19 java开发--struts2 标签库使用
- 2024-04-19 struts2 标签库 介绍
- 2024-04-19 struts2中的标签
- 2024-04-19 Struts标签
你 发表评论:
欢迎- 04-25用微服务平台框架,实现高效的流程化办公!
- 04-25国内主流的低代码开发平台 2024最好用的低代码厂商大全
- 04-25出生率持续下降,而低代码,成了!
- 04-25再探前端低代码的“野路子”
- 04-25APaaS 企业级低代码平台 All In One
- 04-25 巨头布局,资本支持,低代码的好时代要来了?
- 04-25开源微服务低代码的几大亮点内容
- 04-25微服务 SaaS 低代码开发平台
- 0℃未命名
- 最近发表
- 标签列表
-
- gitee (437)
- 码云 (330)
- vant (426)
- pig (303)
- bee (372)
- 文件存储系统 (317)
- gitee图片不显示 (348)
- kettleweb (315)
- 百度开源 (335)
- vs助手 (309)
- crypto-js.js (361)
- vue-element-admin (380)
- g6 (352)
- vconsole (370)
- python基础教程 (329)
- roses (325)
- 表单设计器 (317)
- oa办公 (329)
- yii2 (406)
- uni-ui (362)
- psutil (336)
- hikaricp (386)
- 超级转换 (328)
- tigervnc (328)
- cs-notes (299)
本文暂时没有评论,来添加一个吧(●'◡'●)