会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
SYsunyi
博客园
首页
新随笔
联系
订阅
管理
2017年7月14日
地区三级联动--省份province
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>地区三级联动</title> <script src="./jquery.js"></script></head><body> <h2>地区三级联动</h2> 省份
阅读全文
posted @ 2017-07-14 12:46 SYsunyi
阅读(608)
评论(0)
推荐(0)
2017年7月6日
无限级分类--栏目CRUD
摘要: cats = $this->select();//将获取到的所有数据放到空数组 } public function getTree($parent_id=0,$lev=0){ $tree = array();//声明空数组 foreach($this->cats as $k=>$v){//遍历获取的数据 if($v...
阅读全文
posted @ 2017-07-06 19:39 SYsunyi
阅读(231)
评论(0)
推荐(0)
2017年7月3日
购物车类2分析session+single
摘要: hasItem($goods_id)){ return $this->incNum($goods_id , $num); } $this->items[$goods_id] = array();//此时items为二维数组 $this->items[$goods_id]['goods_name'] = $goods_name...
阅读全文
posted @ 2017-07-03 16:46 SYsunyi
阅读(175)
评论(0)
推荐(0)
购物车类分析session+single
摘要: single = mt_rand(1,10000);//测试代码 } //获取实例。开发一个方法供外部调用 public static function getIns(){ //判断$ins是否是自身的实例 // if(!(self::$ins instanceof self)){ if(self::$ins === nul...
阅读全文
posted @ 2017-07-03 14:58 SYsunyi
阅读(253)
评论(0)
推荐(0)
2017年7月2日
cookie&session的比较
摘要: * ---------------------cookie&session的比较(1)--------------------------- * 1.存储地点: * cookie存储于客户端 * session存储于服务器端 * 2.安全性 * cookie安全性低,易伪造篡改(因存储于客户端) * session安全...
阅读全文
posted @ 2017-07-02 14:42 SYsunyi
阅读(170)
评论(0)
推荐(0)
2017年6月30日
ThinkPHP--浏览历史
摘要: find( ' get.goods_id ' ); if($goods_info){//若获取该条信息成功 //调用history()方法 $this->history($goods_info); //var_dump(session('history')); } $this->assign( ' mbx ' , $this...
阅读全文
posted @ 2017-06-30 21:41 SYsunyi
阅读(401)
评论(0)
推荐(0)
2017年6月29日
ThinkPHP--自动验证
摘要: 属性1=值1 * 2、批量赋值$model->create($arr); * 3、直接create() * create 将自动分析POST数据,并进行赋值到model的数据对象上 * 再调用add(),save()就可以执行添加或者修改 */ /** * 自动验证 * 再TP中,再model中写验证规则,即$_validata属性 * 定义好验证规则后,就可以在使用creat...
阅读全文
posted @ 2017-06-29 17:08 SYsunyi
阅读(156)
评论(0)
推荐(0)
ThinkPHP--面包屑导航
摘要: find($cat_id); $tree[] = $row;//将该条数据放入数组中 while($row['parent_id']>0){//只要该条数据的parent_id>0 $row = D('cat_id')->fine($row['parent_id']); $tree[] = $row; } //array_rever...
阅读全文
posted @ 2017-06-29 16:41 SYsunyi
阅读(2615)
评论(0)
推荐(0)
ThinkPHP--登录退出
摘要: check($yzm)){//调用check方法 return true; }else{ echo '验证码错误'; exit(); } } public function login(){ if(!IS_POST){ $this->display(); }else{ //若验证码验...
阅读全文
posted @ 2017-06-29 16:40 SYsunyi
阅读(541)
评论(0)
推荐(0)
ThinkPHP--会员注册验证
摘要: /** * M层 * (3) 验证提交数据的合法性 * 3.1 Model层声明验证方式 */ class UserModel extends Model{ public $_validate = array( //array(验证字段,验证规则,错误提示,【验证条件,附加条件,验证时间】) array('username' , '3,10' ...
阅读全文
posted @ 2017-06-29 16:38 SYsunyi
阅读(422)
评论(0)
推荐(0)
下一页
公告