?? chpassword.php
字號(hào):
<?php
session_start();
include "middle.php";
require_once "../MessageBox.php";
$date = Date("Y-m-j H:i:s");
$Message = new MessageBox;
if ( !empty($_SESSION["userid"]) ) {
include "../datasource.inc.php";
$a1 =$_REQUEST['a1'];
$a2 =$_REQUEST['a2'];
$a3 =$_REQUEST['a3'];
$date = Date("Y-m-j");
if (!empty($a1) and !empty($a2) ) {
$query1="select * from job_user where userid='$a1' and userpwd=password('$a2');";
$result1=mysql_query($query1);
if ( mysql_num_rows($result1) <= 0 ){
$Message->setMessage("對(duì)不起,您輸入的舊密碼不正確。","chpassword.php");
$Message->showMessage();
} else {
$query="update job_user set userpwd=password('$a3') where userid='$a1';";
$result=mysql_query($query);
$Message->setMessage("修改成功!","chpassword.php");
$Message->showMessage();
}
}
?>
<script language=javascript>
function fucCheckLength(strTemp)
{
var i,sum;
sum=0;
for(i=0;i<strTemp.length;i++)
{
if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
sum=sum+1;
else
sum=sum+2;
}
return sum;
}
function check_input()
{
if (document.form.userid.value=='') {
alert("請(qǐng)輸入帳號(hào)名稱(chēng)!");
return false;
}
if (document.form.a2.value=='') {
alert("請(qǐng)輸入舊密碼!");
return false;
}
if (document.form.a3.value=='') {
alert("請(qǐng)輸入新密碼!");
return false;
}
if (document.form.a4.value=='') {
alert("請(qǐng)?jiān)俅屋斎胄旅艽a!");
return false;
}
if (document.form.a3.value!=document.form.a4.value) {
alert("兩次輸入的密碼不一樣,請(qǐng)重新輸入!");
return false;
}
return true;
}
</script>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
</tr>
<tr>
<td width="776" valign="top">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<TD vAlign=top><FONT color=#565656> <IMG height=14
src="../images/closedfold.gif" width=14> 您當(dāng)前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 用戶(hù)資料管理</FONT></TD>
</tr>
</table>
<table align="right" cellpadding="0" cellspacing="0" width="766">
<tr>
<td bgcolor="#3494D4" height="1"></td>
</tr>
</table>
<br>
<center>
<!--<p align="center"> <b><font size="3">請(qǐng)輸入新帳號(hào)資料</font></b></p>-->
<FORM language=javascript name=form1 onsubmit="return form1_onsubmit()" method=post action="chpassword.php">
<table width="460" border=0 cellpadding=0 cellspacing=0 bgcolor=#3494d4 align=center>
<tr height=24>
<td width="15%" bgColor=#ffffff align=center>帳號(hào)名稱(chēng)</td>
<td width="85%" bgColor=#ffffff>
<?php
if ($_REQUEST['id']){
echo "<font color=red>"."$row[userid]"."</font>";
echo "<input type=hidden size=40 name=a1 maxlength=15 value=\"$row[userid]\">";
}else{
echo "<font color=red>"."$_SESSION[userid]"."</font>";
echo "<input type=hidden size=40 name=a1 maxlength=15 value=\"$_SESSION[userid]\">";
}
?>
</td>
</tr>
<tr height=24>
<td width="15%" bgColor=#ffffff align=center>舊 密 碼</td>
<td width="85%" bgColor=#ffffff>
<input type="password" size="40" name="a2" maxlength="15">
</td>
</tr>
<tr height=24>
<td width="15%" bgColor=#ffffff align=center>新 密 碼</td>
<td width="85%" bgColor=#ffffff>
<input type="password" size="40" name="a3" maxlength="15">
</td>
</tr>
<tr height=24>
<td width="15%" bgColor=#ffffff align=center>新密碼確認(rèn)</td>
<td width="85%" bgColor=#ffffff>
<input type="password" size="40" name="a4" maxlength="15">
</td>
</tr> </table>
<br><input type="hidden" value="update" name="action">
<input type="submit" name="submit" value=" 確 定 "> <input type="reset" name="submit1" value=" 重 置 ">
</form>
<?php
}
?>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -