📄 modifypersonalinformation.asp
字号:
<%@ Language=VBScript %>
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "../Login.asp"
end if
%>
<%
'连接系统数据库
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
'如果用户提交了表单
if not IsEmpty(Request.Form("Send")) then
'进行用户身份校验
if Request.Form("Password") = Session("Password") then
if len(Request.Form("NewPassword"))=0 then
Session("EmailAddress")=Request.Form("EmailAddress")
Session("InternalPhone")=Request.Form("InternalPhone")
Session("HomePhone")=Request.Form("HomePhone")
Session("MobilePhone")=Request.Form("MobilePhone")
Session("QQ")=Request.Form("QQ")
Session("HomeAddress")=Request.Form("HomeAddress")
Session("Birthday")=Request.Form("BirthdayYear") & "-" & Request.Form("BirthdayMonth") & "-" & Request.Form("BirthdayDay")
'更新用户个人信息
conn.Execute " update PSLogins set " _
& "EmailAddress='" & Request.Form("EmailAddress") & "', " _
& "InternalPhone='" & Request.Form("InternalPhone") & "', " _
& "HomePhone='" & Request.Form("HomePhone") & "', " _
& "MobilePhone='" & Request.Form("MobilePhone") & "', " _
& "QQ='" & Request.Form("QQ") & "', " _
& "HomeAddress='" & Request.Form("HomeAddress") & "', " _
& "Birthday='" & Request.Form("BirthdayYear") & "-" _
& Request.Form("BirthdayMonth") & "-" _
& Request.Form("BirthdayDay") & "' " _
& " Where Name='" & Request.Form("Name") &"'"
TheMessage = "您的个人信息已经修改成功"
else
'如果用户输入了新密码
if Request.Form("NewPassword") = Request.Form("ConfirmNewPassword") then
Session("Name") = Request.Form("Name")
Session("Password") = Request.Form("NewPassword")
Session("EmailAddress")=Request.Form("EmailAddress")
Session("InternalPhone")=Request.Form("InternalPhone")
Session("HomePhone")=Request.Form("HomePhone")
Session("MobilePhone")=Request.Form("MobilePhone")
Session("HomeAddress")=Request.Form("HomeAddress")
Session("Birthday")=Request.Form("BirthdayYear") & "-" & Request.Form("BirthdayMonth") & "-" & Request.Form("BirthdayDay")
Session("QQ")=Request.Form("QQ")
Session("HomeAddress")=Request.Form("HomeAddress")
conn.Execute " update PSLogins set " _
& "Password='" & Request.Form("NewPassword") & "', " _
& "EmailAddress='" & Request.Form("EmailAddress") & "', " _
& "InternalPhone='" & Request.Form("InternalPhone") & "', " _
& "HomePhone='" & Request.Form("HomePhone") & "', " _
& "MobilePhone='" & Request.Form("MobilePhone") & "', " _
& "QQ='" & Request.Form("QQ") & "', " _
& "HomeAddress='" & Request.Form("HomeAddress") & "', " _
& "Birthday='" & Request.Form("BirthdayYear") & "-" _
& Request.Form("BirthdayMonth") & "-" _
& Request.Form("BirthdayDay") & "' " _
& " Where Name='" & Request.Form("Name") &"'"
TheMessage = "您的个人信息已经修改成功"
else
TheMessage = "新密码输入不一致,请重试"
end if
end if
else
TheMessage = "您输入的密码有误,请重试"
end if
else
TheMessage = "请在下面修改您的个人信息"
end if
%>
<HTML>
<HEAD>
<TITLE>Employee Email Blast</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<BODY BGCOLOR="">
<table width=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#996633" bgcolor=#164DA8>
<tr bgcolor=white>
<td valign=center bgcolor="#0066CC" >
<div align="center"><font color="#CCCCCC" size="+7" face="华文隶书"><strong>公司内部办公信息管理系统</strong></font></div></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<br>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER"><font size="2">公司内部办公信息管理系统->员工信息管理系统->修改我的个人信息 [当前用户-
<% response.write Session("Name") %>
]</font> </font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD" size="2">返回内网主页</font></a></td>
<td align=center> <font color="#104DAD" ><% response.write TheMessage %></FONT></td>
<td align=right><a href="EmployeeInformation.asp"><font color="#104DAD" size="2">返回上一级网页</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10" colspan="4" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" height="13" cellspacing="0" cellpadding="0" mm_noconvert="TRUE">
<tr>
<td height="13"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<FORM ACTION="ModifyPersonalInformation.asp" METHOD=POST>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=1 bordercolor="#164DA8" WIDTH=800 align=center>
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=30% bgcolor=#B5C7EF><P></td>
<td>
<br>
<table CELLPADDING=0 CELLSPACING=1 BORDER=0 align=center width=100%>
<tr>
<td width=25%><font color="#164DA8" size="2">姓名</font></td>
<td><INPUT TYPE="text" NAME="Name" VALUE="<% response.write Session("Name") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">电子邮件地址</font></td>
<td><INPUT TYPE="text" NAME="EmailAddress" VALUE="<% response.write Session("EmailAddress") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">内部分机电话</font></td>
<td><INPUT TYPE="text" NAME="InternalPhone" VALUE="<% response.write Session("InternalPhone") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">移动电话</font></td>
<td><INPUT TYPE="text" NAME="MobilePhone" VALUE="<% response.write Session("MobilePhone") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">家庭电话</font></td>
<td><INPUT TYPE="text" NAME="HomePhone" VALUE="<% response.write Session("HomePhone") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">QQ号</font></td>
<td><INPUT TYPE="text" NAME="QQ" VALUE="<% response.write Session("QQ") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">生日</font></td>
<td> <select name="BirthdayYear" size=1>
<%
YearCounter= Year(Session("Birthday"))
%>
<option value="<% Response.Write YearCounter %>">  
<% Response.Write YearCounter %>
  </option>
<%
YearCounter = 2000
Do until YearCounter <=1900
%>
<OPTION VALUE="<% Response.Write YearCounter %>">  
<% Response.Write YearCounter %>
  </OPTION>
<%
YearCounter = YearCounter-1
loop
%>
</select>
年   <select name="BirthdayMonth" size=1>
<%
MonthCounter= Month(Session("Birthday"))
%>
<option value="<% Response.Write MonthCounter %>">  
<% Response.Write MonthCounter %>
  </option>
<%
MonthCounter = 1
Do until MonthCounter >12
%>
<OPTION VALUE="<% Response.Write MonthCounter %>">  
<% Response.Write MonthCounter %>
  </OPTION>
<%
MonthCounter = MonthCounter+1
loop
%>
</select>
月   <select name="BirthdayDay" size=1>
<%
DayCounter= Day(Session("Birthday"))
%>
<option value="<% Response.Write DayCounter %>">  
<% Response.Write DayCounter %>
  </option>
<%
DayCounter = 1
Do until DayCounter >31
%>
<OPTION VALUE="<% Response.Write DayCounter %>">  
<% Response.Write DayCounter %>
  </OPTION>
<%
DayCounter = DayCounter+1
loop
%>
</select>
日   </td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">家庭住址</font></td>
<td><INPUT TYPE="text" NAME="HomeAddress" VALUE="<% response.write Session("HomeAddress") %>" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">请输入您的密码</font> </td>
<td><INPUT TYPE="Password" NAME="Password" VALUE="" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">请输入您的新密码</font></td>
<td><INPUT TYPE="Password" NAME="NewPassword" VALUE="" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">请确认您的新密码</font></td>
<td><INPUT TYPE="Password" NAME="ConfirmNewPassword" VALUE="" SIZE=51 MAXLENGTH=50 ></td>
</tr>
</table>
<br>
</td>
</TR>
</table>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=800 align=center>
<TR VALIGN="top" ALIGN="center">
<TD WIDTH=100% align=center >
<INPUT TYPE="submit" NAME="Send" VALUE="修改个人信息" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB"></TD>
</TD>
</TR>
</table>
</FORM>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -