当前位置:Gxlcms > PHP教程 > TP更新数据解决思路

TP更新数据解决思路

时间:2021-07-01 10:21:17 帮助过:2人阅读

TP 更新数据
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}
    
    
            编辑档案
    
    



我要更新的内容
HTML code





                     

人气教程排行