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

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



?>