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值?
- 1 回答
- 0 关注
- 1907 浏览
添加回答
举报
0/150
提交
取消