| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2180 人关注过本帖
标题:求助啊!密码修改不行,也是醉了
只看楼主 加入收藏
批星逮月
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-4-17
收藏
 问题点数:0 回复次数:0 
求助啊!密码修改不行,也是醉了
modify_pwd.php代码:
<?php

    include "../inc/chec.php";
?>
<script src="../js/admin_js.js"></script>
<link href="../css/style.css" rel="stylesheet">
<table width="1100" height="450" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #9CBED6; margin-top:15px;">
<tr><td align="center" valign="middle">
<form name="mod_pwd" id="mod_pwd" method="post" action="modify_pwd_chk.php">
  <table width="300" height="116" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="126" align="right" valign="middle">旧密码:</td>
      <th width="174" align="left" valign="middle"><input name="old_pwd" type="password" id="old_pwd" size="15"></th>
    </tr>
    <tr>
      <td align="right" valign="middle">新密码:</td>
      <td align="left" valign="middle"><input name="new_pwd" type="password" id="new_pwd" size="15"></td>
    </tr>
    <tr>
      <td align="right" valign="middle">确认密码:</td>
      <td align="left" valign="middle"><input name="two_pwd" type="password" id="two_pwd" size="15"></td>
    </tr>
    <tr>
      <td colspan="2" align="center" valign="middle"><input type="submit" nanme="submit" value="修改" onclick="return mod_chk();"></td>
    </tr>
  </table>
</form>
</td></tr></table>

modify_pwd_chk.php代码:
<?php
    session_start();
    include "../inc/chec.php";
    include "../conn/conn.php";
$sqlstr = "select * from tb_controller where id = ".$_SESSION['id']." and mana_pwd = '".$_POST['old_pwd']."'";
    $result = mysql_query($sqlstr,$conn);
    if($rows = mysql_fetch_row($result)){
        $modsql = "update tb_controller set mana_pwd = '".$_POST['new_pwd']."' where id = '".$_SESSION['id']."'";
        if(mysql_query($modsql,$conn))
            echo "<script>alert('密码修改成功');history.go(-1);</script>";
        else
            echo "<script>alert('密码修改失败');history.go(-1);</script>";
    }
    else{
        echo "<script>alert('密码错误,请重新输入!');history.go(-1);</script>";
    }
?>

搜索更多相关主题的帖子: 密码修改 include action border center 
2015-04-17 21:26
快速回复:求助啊!密码修改不行,也是醉了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022701 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved