谁可以帮我看看吗?这是哪里错了,谢谢

@Ta 2013-11-06 1578点击

<?
$html->head('用户密码修改-'.$config['http_name']);

if($myid==0){
$html->tip('请登陆后再操作','red');
exit;
}


$html->formstart(url::makeURL('userxg'))
->content('请输入旧密码:')->br()
->input('old_pass',$old_pass)              ->br()
->content('请输入新密码:')->br()
->input('pass',$pass)              ->br()
->hidden('action','yes')
->submit('submit','保存修改')
->formend();

$action=isset($_POST['action']) ?  trim($_POST['action']) : null;


if($action=='yes'){
$err=0;
$err_msg="";
$ok=0;
$ok_msg="";


$pass=isset($_POST['pass']) ?  trim($_POST['pass']) : null;//获取post值
$old_pass=isset($_POST['old_pass']) ?  trim($_POST['old_pass']) : null;//获取post值

if(strlen($old_pass)==0){
	$err++;
	$err_msg.="旧密码不能为空!
";
	}
if(strlen($pass)<6 or strlen($pass)>20){
	$err++;
	$err_msg.="密码控制在6到20位之间!
";
	}
if($err==0){
	  $rs=$data->query("select * from `user_user` where `pass`='$old_pass' and `id`=$myid");
		if($row=mysql_fetch_array($rs)){


$sid=md5($pass.md5(time()));


if($data->query("update `user_user` set `pass`='$pass',`sid`='$sid' where `id`=$myid")){
	 $ok++;
	 $ok_msg.="修改成功!已经重置你的SID,您不用重新登录,但需要重新保存书签!<br />";
	}else{
		$err++;
		$err_msg.="修改失败!请检查!<br />";
		}

			 }else{
			    $err++;
				$err_msg.="抱歉,旧密码不符合!";
				
								 }
			mysql_free_result($rs);
		 
	 }


	}
		$rs=$data->query("select * from `user_user` where `id`=$myid");
		if($row=mysql_fetch_array($rs)){
			    if(empty($row['pass'])){
					$row["pass"]="还没有设置密码!";
					}
			}else{
				   $err++;
				   $err_msg.="不存在的会员信息!
";
				}
		mysql_free_result($rs);



$html->tip($errmsg,'red');
?>

回复列表(2|隐藏机器人聊天)
添加新回复
回复需要登录