public function submit() { $id = (int) input('post.id'); $data['username'] = Session::get('username'); $data['content'] = trim(input('post.content')); if ($data['content'] == '') { exit(json_encode(array('code' => 1, 'msg' => '内容不能为空'))); } else { $this->db->table('message')->insert($data); } $mes = $this->db->table('message')->where(array('username' => $data['username']))->item(); $this->assign('mes', $mes); exit(json_encode(array('code' => 0, 'msg' => '留言成功'))); return $this->fetch(); }
在thinkphp中应该如何保存session值?
qq_慕斯卡3596994