本文整理汇总了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');
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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');
// }
}
示例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();
}
}
示例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();
}
示例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();
}