当前位置: 首页>>代码示例>>PHP>>正文


PHP Cookie函数代码示例

本文整理汇总了PHP中Cookie函数的典型用法代码示例。如果您正苦于以下问题:PHP Cookie函数的具体用法?PHP Cookie怎么用?PHP Cookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Cookie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->meta_title = '栏目管理';
     $this->display('Profile/Category/index');
 }
开发者ID:slpi1,项目名称:onethink_multi_site,代码行数:7,代码来源:CategoryController.class.php

示例2: edit

 public function edit($id = null)
 {
     if (IS_POST) {
         $SeoRule = D('SeoRule');
         $data = $SeoRule->create();
         if ($data) {
             if ($SeoRule->save()) {
                 $cacheKey = "qt_seo_meta_" . $data['app'] . "_" . $data['controller'] . "_" . $data['action'];
                 S($cacheKey, null);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($SeoRule->getError());
         }
     } else {
         $info = array();
         $info = M('SeoRule')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->display();
     }
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:26,代码来源:SeoController.class.php

示例3: login

 /**
  * 登陆
  */
 public function login()
 {
     if (IS_POST) {
         $username = I('username');
         $password = I('password');
         $remenber = I('remenber');
         if (!$username) {
             $this->error('请输入姓名!');
         }
         if (!$password) {
             $this->error('请输入身份证!');
         }
         $user_object = D('Student');
         $uid = $user_object->login($username, $password);
         if (0 < $uid) {
             $this->success('登录成功!', Cookie('__forward__') ?: C('HOME_PAGE'));
         } else {
             $this->error($user_object->getError());
         }
     } else {
         if (is_login()) {
             $this->error("您已登陆系统", Cookie('__forward__') ?: C('HOME_PAGE'));
         }
         $this->display();
     }
 }
开发者ID:jason2014,项目名称:bys,代码行数:29,代码来源:PublicController.class.php

示例4: index

 public function index()
 {
     $banner = $this->getBanner($this->PageFeature['ControllerName']);
     $this->assign('banner', $banner);
     $tab = $this->getTab();
     $this->assign('tabs', $tab);
     $tabVideo = NULL;
     //获得tabVideo
     foreach ($tab as $key => $value) {
         $tabVideo[$key] = $this->getTabVideo($value['id']);
         //转换数据
         foreach ($tabVideo[$key] as $key1 => $value1) {
             $tabVideo[$key][$key1]['create_time'] = date('Y-m-d', $value1['create_time']);
             $tabVideo[$key][$key1]['update_time'] = date('Y-m-d', $value1['update_time']);
             //获得教师信息
             $teach = $this->getInfo($value1['authority']);
             $tabVideo[$key][$key1]['name'] = $teach[0]['name'];
             $tabVideo[$key][$key1]['company'] = $teach[0]['company'];
             //var_dump( $value1);
         }
     }
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->assign('tabVideo', $tabVideo);
     $this->display();
 }
开发者ID:Ant-Ferry,项目名称:ant-teaching,代码行数:25,代码来源:AuditoriumController.class.php

示例5: edit

 /**
  * 编辑订单
  * @author 烟消云散 <1010422715@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Form = D('change');
         if ($_POST["id"]) {
             $id = $_POST["id"];
             $Form->create();
             $result = $Form->where("id='{$id}'")->save();
             if ($result) {
                 //记录行为
                 action_log('update_change', 'change', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败,换货单' . $id);
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('change')->find($id);
         $list = M('change')->where("shopid='{$id}'")->select();
         if (false === $info) {
             $this->error('获取订单信息错误');
         }
         $this->assign('list', $list);
         $this->assign('info', $info);
         $this->meta_title = '编辑订单';
         $this->display();
     }
 }
开发者ID:FortuneZhang,项目名称:yershop,代码行数:36,代码来源:ChangeoverController.class.php

示例6: edit

 /**
  * 编辑
  * @author 烟消云散 <1010422715@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Form = D('records');
         if ($_POST["id"]) {
             $id = $_POST["id"];
             /*更新时间*/
             $Form->time = NOW_TIME;
             /* 编辑后新增系统反馈信息*/
             $Form->info = $_POST["info"];
             $result = $Form->where("id='{$id}'")->save();
             if ($result) {
                 //记录行为
                 action_log('update_backlist', 'backlist', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败' . $id);
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('records')->find($id);
         $list = M('records')->where("id='{$id}'")->select();
         if (false === $info) {
             $this->error('获取订单信息错误');
         }
         $this->assign('list', $list);
         $this->assign('info', $info);
         $this->meta_title = '编辑订单';
         $this->display();
     }
 }
开发者ID:FortuneZhang,项目名称:yershop,代码行数:39,代码来源:LookupController.class.php

示例7: edit

 /**
  * 编辑配置
  * @author 麦当苗儿 <zuojiazi@vip.qq.com>
  */
 public function edit($id = 0)
 {
     $DataModel = D('Friendlink');
     if (IS_POST) {
         $data = $DataModel->create();
         if ($data) {
             if ($DataModel->save($data)) {
                 S('DB_CONFIG_DATA', null);
                 //设置缓存
                 //记录行为
                 action_log('update_config', 'Friendlink', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($DataModel->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = $DataModel->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑配置';
         $this->display();
     }
 }
开发者ID:BuleAnt,项目名称:Platform,代码行数:34,代码来源:FriendlinkController.class.php

示例8: login

 /**
  * 管理员登录
  */
 public function login()
 {
     if (IS_POST) {
         $adm_id = I('adm_id');
         $adm_pw = I('adm_pw');
         # 图片验证码校验
         if (!$this->check_verify(I('post.verify'))) {
             $this->error('验证码输入错误!');
         }
         if (!$adm_id) {
             $this->error('请输入管理员!');
         }
         if (!$adm_pw) {
             $this->error('请输入密码!');
         }
         $ADM = D('Admin');
         $uid = $ADM->login($adm_id, $adm_pw);
         if (0 < $uid) {
             $this->redirect('Index/index');
         } else {
             $this->error($ADM->getError());
         }
     } else {
         if (is_login('Admin')) {
             $this->error("您已登陆系统", Cookie('__forward__') ?: C('HOME_PAGE'));
         }
         $this->meta_title = '管理员登录';
         $this->display();
     }
 }
开发者ID:rainbow88,项目名称:zsy,代码行数:33,代码来源:LoginController.class.php

示例9: edit

 /**
  * 编辑配置
  * @author yangweijie <yangweijiester@gmail.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Menu = D('Menu');
         $data = $Menu->create();
         if ($data) {
             if ($Menu->save() !== false) {
                 // S('DB_CONFIG_DATA',null);
                 //记录行为
                 action_log('update_menu', 'Menu', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Menu->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('Menu')->field(true)->find($id);
         $menus = M('Menu')->field(true)->select();
         $menus = D('Common/Tree')->toFormatTree($menus);
         $menus = array_merge(array(0 => array('id' => 0, 'title_show' => '顶级菜单')), $menus);
         $this->assign('Menus', $menus);
         if (false === $info) {
             $this->error('获取后台菜单信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑后台菜单';
         $this->display();
     }
 }
开发者ID:Germey,项目名称:SimpleCMS,代码行数:37,代码来源:MenuController.class.php

示例10: edit

 /**
  * 编辑业务
  * @author 温开元<wenkaiyuan.6@163.com 594164084@qq.com>
  */
 public function edit($id = 0)
 {
     if (IS_POST) {
         $Business = D('Business');
         $data = $Business->create();
         if ($data) {
             if ($Business->save()) {
                 //记录行为
                 // action_log('update_business', 'Business', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Business->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = M('Business')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取业务信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑业务';
         $this->display();
     }
 }
开发者ID:sakiyo,项目名称:onethink_advertising_business,代码行数:32,代码来源:BusinessController.class.php

示例11: edit

 public function edit($id = null)
 {
     if (IS_POST) {
         $Config = D('SystemConfig');
         $data = $Config->create();
         if ($data) {
             if ($Config->save()) {
                 S('DB_CONFIG_DATA', null);
                 $this->success('更新成功', Cookie('__forward__'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($Config->getError());
         }
     } else {
         $info = array();
         $info = M('SystemConfig')->field(true)->find($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->display();
     }
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:25,代码来源:ConfigController.class.php

示例12: save

 function save()
 {
     $Brand = D('Brand');
     $data = $Brand->create();
     if ($data) {
         $id = $Brand->add();
         if ($id) {
             // S('DB_CONFIG_DATA',null);
             //记录行为
             action_log('update_menu', 'Menu', $id, UID);
             $this->success('新增成功', Cookie('__forward__'));
         } else {
             $this->error('新增失败');
         }
     } else {
         $this->error($Brand->getError());
     }
     //        if(IS_POST){
     //
     //        } else {
     //            $this->assign('info',array('pid'=>I('pid')));
     //            $menus = M('Menu')->field(true)->select();
     //            $menus = D('Common/Tree')->toFormatTree($menus);
     //            $menus = array_merge(array(0=>array('id'=>0,'title_show'=>'顶级菜单')), $menus);
     //            $this->assign('Menus', $menus);
     //            $this->meta_title = '新增菜单';
     //            $this->display('edit');
     //        }
 }
开发者ID:rainly123,项目名称:zs,代码行数:29,代码来源:TestController.class.php

示例13: edit

 /**
  * 编辑配置
  * @author 麦当苗儿 <zuojiazi@vip.qq.com>
  */
 public function edit($id = 0)
 {
     $DataModel = D('ResourceTab');
     if (IS_POST) {
         //$Config = D('Config');
         $data = $DataModel->create();
         if ($data) {
             if ($DataModel->updateData(null, $data)) {
                 S('DB_TAB_DATA', null);
                 //记录行为
                 action_log('update_config', 'ResourceTab', $data['id'], UID);
                 $this->success('更新成功', Cookie('__forward__'));
                 //$this->success('更新成功', U('index'));
             } else {
                 $this->error('更新失败');
             }
         } else {
             $this->error($DataModel->getError());
         }
     } else {
         $info = array();
         /* 获取数据 */
         $info = $DataModel->getValue($id);
         if (false === $info) {
             $this->error('获取配置信息错误');
         }
         $this->assign('info', $info);
         $this->meta_title = '编辑配置';
         $this->display();
     }
 }
开发者ID:BuleAnt,项目名称:Platform,代码行数:35,代码来源:TabController.class.php

示例14: index

 /**
  * 订单管理
  * author 烟消云散 <1010422715@qq.com>
  */
 public function index()
 {
     /* 查询条件初始化 */
     $status = $_GET['status'];
     if (isset($_GET['status'])) {
         switch ($status) {
             case '1':
                 $map['status'] = $status;
                 $meta_title = "未使用快递管理";
                 break;
             case '2':
                 $map['status'] = $status;
                 $meta_title = "已使用快递管理";
                 break;
         }
     } else {
         $status = '';
         $meta_title = "快递管理";
     }
     if (isset($_GET['time-start'])) {
         $map['update_time'][] = array('egt', strtotime(I('time-start')));
     }
     if (isset($_GET['time-end'])) {
         $map['update_time'][] = array('elt', 24 * 60 * 60 + strtotime(I('time-end')));
     }
     $this->assign('status', $status);
     $this->meta_title = $meta_title;
     $list = $this->lists('Express', $map, 'id desc');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display();
 }
开发者ID:gitchenze,项目名称:soloshop,代码行数:37,代码来源:ExpressController.class.php

示例15: index

 /**
  * 短信管理列表
  * @author 麦当苗儿 <zuojiazi@vip.qq.com>
  */
 public function index()
 {
     $status = $_GET['status'];
     if (isset($_GET['status'])) {
         switch ($status) {
             case '1':
                 $map['status'] = $status;
                 $meta_title = "日志管理";
                 break;
         }
     } else {
         $status = 1;
         $map = array('status' => 1);
         $meta_title = "日志管理";
     }
     if (isset($_GET['title'])) {
         $map['title'] = array('like', '%' . (string) I('title') . '%');
     }
     if (isset($_GET['time-start'])) {
         $map['update_time'][] = array('egt', strtotime(I('time-start')));
     }
     if (isset($_GET['time-end'])) {
         $map['update_time'][] = array('elt', 24 * 60 * 60 + strtotime(I('time-end')));
     }
     if (isset($_GET['nickname'])) {
         $map['uid'] = M('Member')->where(array('nickname' => I('nickname')))->getField('uid');
     }
     $this->meta_title = $meta_title;
     $this->assign('status', $status);
     $list = $this->lists('UserLog', $map, 'id desc');
     $this->assign('list', $list);
     // 记录当前列表页的cookie
     Cookie('__forward__', $_SERVER['REQUEST_URI']);
     $this->display();
 }
开发者ID:gitchenze,项目名称:soloshop,代码行数:39,代码来源:UserLogController.class.php


注:本文中的Cookie函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。