<?php
include '../comm/config.php';
include '../comm/checkpostandget.php';
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die('数据库链接出错');exit;
}
mysql_select_db($dbname);

$username=$_POST['usename'];
	if($username =="")
	{
		echo "<meta http-equiv='Content-Type' content='text/html; charset=gbk' /><Script language='JavaScript'> alert('用户名为空！请填写！');location.href='repaword.php';</Script>";
	}
$pwd=$_POST['password']; $link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
     die('connect to database failed! ' . mysql_error());
}
mysql_select_db($dbname);

mysql_query("set names gbk");
$pwd=md5($pwd);
$sql = "update user set ddpassword='$pwd' where ddusername='".$username."'";

mysql_query($sql);
mysql_close($link);
header('Location: reset_ok.php');     

?>
