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 關注
- 1965 瀏覽
添加回答
舉報
0/150
提交
取消