日期:2014-05-17 浏览次数:20759 次
<?php这个 哪里出了错误。
session_start();
header("Content-type:text/html; charset=utf-8");
include '../config.php';
if($_SESSION['admin']=='') header('location:index.php');
$show = "display:none;";
$sql = "SELECT * FROM `cp_admin` WHERE `id`='1'";
$ret = mysql_query($sql);
$row = mysql_fetch_assoc($ret);
if($_POST){
$admin = $_POST['admin'];
$pass = $_POST['pass'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
if($row['name']!=$admin && $row['pwd']!=md5($pass) && $pass1!=$pass2){
echo "<script>alert('修改失败,原因:原始密码不正确,或者两次输入的密码不相同!')</script>";
}else{
$pass1=md5($pass1);
$sql1 = "UPDATE `cp_admin` SET `name`='{$admin}',`pwd`='$pwd2).', WHERE `id`='1'";
mysql_query($sql1);
echo "<script>alert('修改成功!')</script>";
echo "<script language=\"javascript\">location.href='exit.php';</script>";
$show = "display:block;";
}
}
?>