user模块useraction.class.php
<?php
class UserAction extends Action {
public function index(){
$m=M('User');//操作的数据库表
$arr=$m->select();//查询数据库
$this->assign('data',$arr);//
$this->display();
}
/*
* 向数据库插入数据
**/
public function add(){
$m=M('User');
$m->username=$_POST['username'];
$m->sex=$_POST['sex'];
$num=$m->add();
if ($num>0){
$this->success('添加成功','index');//添加成功并返回首页
}else {
$this->error('添加失败');
}
}
/*
* 显示添加表单
**/
public function addform(){
$this->display();
}
}
?>
适用于中小型企业的网站后台程序,采用VS2008(2.0)+ACCESS+Jquery 开发,源码作为研究和学习之用,本人非高手,源码有不合理之处请指点。后台框架:公司信息管理基本信息、公告信息、公司简介、联系我们、招聘信息、招商信息产品信息管理分类管理、添加分类、产品信息、添加产品展示信息管理展示信息、添加展示订单信息管理订单信息资讯信息管理分类管理、添加分类、资讯信息、添加资讯系统信息管理友情
0
首页模板文件index.html
<html>
<head>
<title></title>
<script>
function jump(){
window.location='__URL__/addform';
}
</script>
</head>
<body>
<table border="1">
<tr>
<th>ID号</th>
<th>用户名</th>
<th>性别</th>
<th>操作</th>
</tr>
<volist name='data' id='vo'>
<tr>
<td>{$vo.id}</td>
<td>{$vo.username}</td>
<td>{$vo.sex}</td>
<td>删除|修改</td>
</tr>
</volist>
</table>
<button onclick="jump()">添加用户</button>
</body>
</html>
<html> <head> <title></title> </head> <body> </body> </html>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号