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

📄 usermodify.asp

📁 在线考试系统的设计与实现
💻 ASP
字号:
<%if session("loginname")<>"" then%>
<!--#include file="db.inc"-->
<%set rs=server.createobject("ADODB.recordset")
rs.open "select * from user where username='"&session("loginname")&"'",conn,1
%>
<html>
<title>修改资料</title>
<script language="vbscript">
<!--
Sub datacheck()
  dim i,temp,email,oicq,page,address
    
  If user.psw.value = Empty Then
     MsgBox "「密码」不得为空白!", 64, "Oh no!"
     user.psw.focus
     Exit  Sub
  End if
 
  If user.psw.value <> user.againpsw.value Then
     MsgBox "「确认密码」和「密码」不同!", 64, "Oh no!"
     user.againpsw.focus
     Exit Sub
  End if
  address=trim(user.address.value)
  if address=Empty then
     MsgBox "地址不能为空!", 64, "Oh no!"
	 user.address.focus
	 exit sub
  end if
  
  email=trim(user.email.value)
  If email="" or email="@" or InStr(1,email, "@") = 0 Then
     MsgBox "E-mail为空或未含 '@' 字元!", 64, "Oh no!"
     user.email.value
     Exit Sub
  End if
  
  if  user.oicq.value=Empty Then
  user.oicq.value="000000"
  else
  oicq=trim(user.oicq.value)
  if  len(oicq)<5 or len(oicq)>9 then
      MsgBox "OICQ长度不符!", 64, "Oh no!"
	  user.oicq.focus
	  exit sub
  end if
  for i=1 to len(oicq)
  temp=mid(oicq,i,1)
  if asc(temp)<48 or asc(temp)>57 then
       MsgBox "OICQ含非法字符!", 64, "Oh no!"
	   user.oicq.focus
	   exit sub
  end if
  next 
  end if
  
  page=trim(user.homepage.value)
  if page="" or page="http://" then
  user.homepage.value="http://"
  else
  if instr(1,page,".",0)=0 then
      MsgBox "个人主页地址输入有误!", 64, "Oh no!"
	  user.homepage.focus
	  exit sub
  end if
  end if
  
	  
  'Submit(传送)表单资料至Web Server
  user.Submit
End Sub
-->
</script>
<BODY vLink=#333333 aLink=#333333 link=#333333 bgColor=#ffffff leftMargin=0 
topMargin=0><LINK href="forum.css" type=text/css 
rel=stylesheet>
<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center bgColor=#777777 
border=0>
  <TBODY> 
  <TR>
    <TD>
      <table style="COLOR: #000000" cellspacing=0 cellpadding=4 width="100%" 
      border=0 bgcolor="#eeeeee" align="center">
        <tbody> 
        <tr> 
          <td width="27%" height="4"><font color="#FF0000">&gt;&gt;</font>欢迎您,<b> 
            <%if session("loginname")="" then %>
            请先登录! 
            <%end if%>
            <%=session("loginname")%></b></td>
          <td width="62%" height="4"><img src="images/reg.gif" width="16" height="16" align="absmiddle"><a href="reg.asp">用户注册</a>|<img src="images/login.gif" width="16" height="16"><a href="login.asp">用户登录</a>|<img src="images/update.gif" width="16" height="16"><a href="usermodify.asp">修改资料</a>|<img src="images/message.gif" width="21" height="14">现在时间:<%=now()%></td>
          <td width="11%" height="4"> 
            <div align="right"><img src="images/home.gif" width="14" height="14" align="absmiddle">返回首页</div>
    </td>
  </tr>
  </tbody>
</table></TD></TR></TBODY></TABLE>
<!--#include file="chanbody.asp"-->
<form name="user" method="post" action="update.asp" >
  <table width="95%" border="0" align="center" height="252" cellpadding="1" cellspacing="1" bgcolor="#777777">
    <tr> 
      <td colspan="2" bgcolor="#EEEEEE" height="7"> 
        <div align="center"><b>新用户注册</b></div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="28" width="25%">用户名</td>
      <td width="75%" height="28"> <%=rs("username")%> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="21" width="25%">性别</td>
      <td height="21" width="75%">
        <%if rs("sex")="男" then%>
        <input type="radio" CHECKED value="男" name="sex"  >
        <img src="images/Male.gif" width="25" height="27"> 男孩 
        <input type="radio" name="sex"  value="女"  >
        <img src="images/Female.gif" width="27" height="27"> 女孩 <font color="#FF0000">**</font> 
      <%else%>
      <input type="radio" value="男" name="sex"  >
        <img src="images/Male.gif" width="25" height="27"> 男孩 
        <input type="radio" CHECKED name="sex"  value="女"  >
        <img src="images/Female.gif" width="27" height="27"> 女孩 <font color="#FF0000">**</font> 
      <%end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="25%">密码</td>
      <td width="75%"> 
        <input type="password" name="psw" size="20" maxlength="20" value="<%=session("password")%>" >
        (不能包含中文) <font color="#FF0000">**</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="25%">确认密码</td>
      <td width="75%"> 
        <input type="password" name="againpsw" size="20" maxlength="20" value="<%=session("password")%>">
        <font color="#FF0000">**</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="7" bordercolor="#FFFFFF" width="25%">来自何处</td>
      <td width="75%" height="7"> 
        <input type="text" name="address" size="10" maxlength="10" value="<%=rs("address")%>" >
        <font color="#FF0000">**</font> (如:福建泉州))</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="7" bordercolor="#FFFFFF" width="25%">头像</td>
      <td width="75%" height="7"> 
        <div align="center"> 
          <% for i=1 to 24
		if i=clng(rs("face")) then %>
          <input type="radio" name="face" value="<%=i%>" checked>
          <img src="images/<%=i%>.bmp" widht="25" height="25"> 
          <%else%>
          <input type="radio" name="face" value="<%=i%>">
          <img src="images/<%=i%>.bmp" widht="25" height="25"> 
          <%end if%>
          <%if i mod 8=0  then response.write "&nbsp;<br>"
		next%>
        </div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="25%">E-mail</td>
      <td width="75%"> 
        <input type="text" name="email" size="20" maxlength="40" value="<%=rs("email")%>">
        (如:wjke@263.net) <font  color="#FF0000">**</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="2" width="25%">OICQ</td>
      <td width="75%" height="2"> 
        <input type="text" name="oicq" size="15" maxlength="15" value="<%=rs("oicq")%>">
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="25%">个人主页</td>
      <td width="75%"> 
        <input type="text" name="homepage" size="30" maxlength="40" value="<%=rs("page")%>">
      </td>
    </tr>
    <tr bgcolor="#eeeeee"> 
      <div align="center"> 
        <td colspan="2" height="1"> 
          <div align="center"> 
            <input type="button"  value="提交" onclick="datacheck">
            <input type="reset"  value="重置">
          </div>
        </td>
      </div>
    </tr>
  </table>
</form>
<%else
response.redirect "login.asp"
end if%>
<!--#include file="footer.asp"-->
</body>
</html>

⌨️ 快捷键说明

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