<?php


require( "_inc.php" );
$pwd1 = !empty( $_POST['pwd1'] ) ? trim( $_POST['pwd1'] ) : "";
$pwd2 = !empty( $_POST['pwd2'] ) ? trim( $_POST['pwd2'] ) : "";
if ( $pwd1 != $pwd2 )
{
	exit( "操作失败<br>你两次输入的新密码不相同。" );
}
if ( !empty( $pwd1 ) )
{
	$pwdSql = "f_pwd='".md5( $pwd1 )."'";
}
$sql = "UPDATE ".$gDb['prefix'].( "users SET ".$pwdSql." WHERE (f_id='{$dUserId}')" );
$db->query( $sql );
header( "location: done.php?b=".base64_encode( "account.php" ) );
?>
