当前位置:Gxlcms > PHP教程 > 批改密码PHP

批改密码PHP

时间:2021-07-01 10:21:17 帮助过:35人阅读

修改密码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 "";
}else{
$pass1=md5($pass1);
$sql1 = "UPDATE `cp_admin` SET `name`='{$admin}',`pwd`='$pwd2).', WHERE `id`='1'";
mysql_query($sql1);
echo "";

echo "";
$show = "display:block;";

}
}
?>
这个 哪里出了错误。
------解决方案--------------------
本帖最后由 xuzuning 于 2012-11-24 10:16:01 编辑

"UPDATE `cp_admin` SET `name`='{$admin}',`pwd`='$pwd2).', WHERE `id`='1'"
?????????
------解决方案--------------------
不如贴出你的错误信息

人气教程排行