<?php 
session_start(); //开着身份验证，以
include("../sql/conn.php"); /////写
header("Content-type: text/html; charset=utf-8"); 
$llym = $_SERVER["HTTP_REFERER"];
?>


<?php
if($_GET['xg']=='xg')
{



	$result = mysql_query("SELECT * FROM ".$b_qz."_user where user_1 ='".$_SESSION['user_1']."'");
	while($row = mysql_fetch_array($result))
	{
	$pass = $row['pw'];
	}

	if($_POST["ps1"]==$pass){
	}else{
	echo "<script>alert('原密码错误！');</script>";
	echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
	exit;
	}


	if($_POST["ps2"]==$_POST["ps3"]){
	}else{
	echo "<script>alert('两次输入不同！');</script>";
	echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
	exit;
	}
		mysql_query("UPDATE ".$b_qz."_user SET pw = '".$_POST["ps3"]."' WHERE user_1 = '".$_SESSION['user_1']."'");

		mysql_query("INSERT INTO ".$b_qz."_text (user, ip1, time1, dm, ting) VALUES 
		('".$_SESSION['user_1']."','".$iipp."','".$noww."', 'password_xg','修改密码')");



echo "<script>alert('修改密码成功！');</script>";
echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;

}
?>


<?php include("../sql/close.php"); /////写?>



