⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changepass.php

📁 希普办公网络v2
💻 PHP
字号:
<?
include('session.php');
include('function.php');
include('config.php');
if (islogin($_SESSION['username'],$_SESSION['userpass']))
$accept=true;
else 
{
$accept=false;

echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改密码</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<?
if ($accept&&$_POST['change'])
{
	if (islogin($_SESSION['username'],$_POST['bpass']))
	{ 	
		if ($_POST['npass']!=""&&$_POST['cpass']!=""&&$_POST['npass']==$_POST['cpass'])
		{	
			
			if ($_SESSION[username]=="guest")
			$_POST[npass]="guest";
			$query_ch="update worker set login_pass='".$_POST['npass']."' where login_name='".$_SESSION['username']."'";
			mysql_select_db($dbname);
			if(mysql_query($query_ch,$link))
			{
				$_SESSION['userpass']=$_POST['cpass'];
				$errormeg="修改成功";
				}
			else
				$errormeg="意外错误".$query_ch.mysql_error();	
			}
		else
			$errormeg="请检查新密码,确认不为空并且一直";	
		}
	else 
		$errormeg="您提供的旧密码不正确";	
	}
	
	
?>


<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="16" valign="top"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="4%"><img src="images/tleft.jpg" width="50" height="18"></td>
          <td width="91%" background="images/dmid.jpg">&nbsp;</td>
          <td width="5%"><img src="images/tright.jpg" width="50" height="18"></td>
        </tr>
      </table>
      <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F3F7FC">
        <tr> 
          <td height="45" valign="top" class="tian4"><div align="center"> 
              <table width="350" border="0" cellspacing="0" cellpadding="0"  class="table_kuang">
                <tr> 
                  <td width="429" height="40" valign="top"><form name="form1" method="post" action="changepass.php">
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr> 
                          <td colspan="2" class="tianchong"><input name="change" type="hidden" id="change" value="true">
                            动作 -&gt; 修改密码(<font color="#FF0000">*为必填)</font></td>
                        </tr>
                        <tr> 
                          <td colspan="2" class="tianchong"> <div align="left"><font  size="+4"><? echo $errormeg; ?></font> 
                            </div></td>
                        </tr>
                        <tr> 
                          <td width="28%" class="tianchong"> 原来密码: </td>
                          <td width="72%" class="tianchong"><input name="bpass" type="password" class="form_format" id="bpass" 
												  onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" size="20" > 
                            <font color="#FF0000">*</font></td>
                        </tr>
                        <tr> 
                          <td class="tianchong">新 密 码:</td>
                          <td class="tianchong"><input name="npass" type="password" id="npass" size="20"> 
                            <font color="#FF0000">*</font></td>
                        </tr>
                        <tr> 
                          <td class="tianchong">重复新密码: </td>
                          <td class="tianchong"><input name="cpass" type="password" id="cpass" size="20">
                            <font color="#FF0000">*</font></td>
                        </tr>
                        <tr> 
                          <td colspan="2" class="tianchong"> <div align="left"> 
                            </div></td>
                        </tr>
                        <tr> 
                          <td colspan="2" class="tianchong"><div align="center"> 
                              <input name="Submit" type="submit" value="修改"class="buton"   onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3' ">
                            </div></td>
                        </tr>
                      </table>
                    </form></td>
                </tr>
              </table>
              <p> 
                <input type="button" name="Submit3" value="关闭窗口" onClick="window.close(); return false;" class="buton"  onMouseOver ="this.style.backgroundColor='#879BD8'" onMouseOut ="this.style.backgroundColor='#f3f7f3'">
              </p>
            </div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -