/*
* 重置密码
*/
public function resetpsw(){
if(IS_POST){
$Model = M("user");
$loginuser = session("loginuser");
$data["password"] = (md5($_REQUEST["password"]));
$data = $this->create($data);
if($data){
$Model = $this->where(array("id"=>$loginuser))->save($data);
$this ->success("编辑成功");
}else{
$error = D('user')->getError();
$this->error($error ? $error : "操作失败!");
}
}
//跳转到修改页面
$this ->display('resetpsw');
}
最佳答案