TP 更新数据解决思路
程序员文章站
2022-06-01 17:40:55
...
TP 更新数据
获取HTML 信息
我要更新的内容
- PHP code
//个人档案 public function geren(){ if(!isset($_SESSION[C("USER_AUTH_KEY")])){ $msg="请登录"; }else{ $msg=$_SESSION[C("USER_AUTH_KEY")]; } $this->assign('msg',$msg); //==================获取登录信息============================ $gr=M("admin"); $baide=$gr->select(); $this->assign("baide",$baide); $this->assign("title",'极限互动办公自动化系统'); $this->display(); } public function upgr(){//修改edit 内容 header("Content-Type:text/html; charset=utf-8"); $Form = M("admin"); $data['id'] = $_GET['id']; $data['name'] = $_GET['name']; $data['password'] = $_GET['password']; $data['sex'] = $_GET['sex']; $data['bumen'] = $_GET['bumen']; $data['TEL'] = $_GET['TEL']; $data['QQ'] = $_GET['QQ']; $data['email'] = $_GET['email']; $data['dizhi'] = $_GET['dizhi']; $data['img'] = $_GET['img']; if($data){ $upgr=$Form->where('id='.$data['id'])->save($data); if($upgr){ echo ""; }else{ echo ""; } } }
获取HTML 信息
- HTML code
{$baide.name} {$baide.sex} {$baide.TEL} {$baide.QQ} {$baide.email} {$baide.dizhi} 编辑档案
我要更新的内容