<?php
session_start();
header("content-type:text/html;charset=utf-8");
error_reporting(0);
if(!isset($_SESSION['username'])){
   exit; 
}
require "../myadmin/sql.php";
$username=$_POST['hidden_username'];
$password=$_POST['new_pass'];
$password2=$_POST['new_pass2'];
$add_sql="update user set password='{$password2}' where username='{$username}'";

if(mysql_query($add_sql)){
  echo "<script>alert('修改成功！');</script>";
}else{
  echo "<script>alert('修改失败！');</script>";
}
  echo "<script>location='../user/user_index.php';</script>";



?>