PHP头条
热点:

批改密码PHP


修改密码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 "location.href='exit.php';《script》";
    $show = "display:block;";
  
  }
 }
 ?>
这个 哪里出了错误。
------解决方案--------------------
本帖最后由 xuzuning 于 2012-11-24 10:16:01 编辑 "UPDATE `cp_admin` SET `name`='{$admin}',`pwd`='$pwd2).', WHERE `id`='1'"
?????????
------解决方案--------------------
不如贴出你的错误信息

www.phpzy.comtrue/phprm/13737.htmlTechArticle批改密码PHP 修改密码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'...

相关文章

相关频道:

PHP之友评论

今天推荐