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

📄 user_myedit.asp

📁 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会
💻 ASP
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="init.inc" -->
<%
userno=Request.QueryString("userno")
if userno="" then
	userno=Session("userno")
else
	if Session("userqx")>="1" and Session("userqx")="9" then
	else
		userno=Session("userno")
	end if	
end if		
if userno="" then Response.Redirect "user_login.asp"

myurl="user_myedit.asp?userno="&userno
backurl="user_center.asp?userno="&userno&"&xgflag=1"
tablename="userinfo"
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")
bz=1
if Request.ServerVariables("REQUEST_METHOD")="POST" then
	bz=0
	realname=trim(Request.Form("realname"))
	sex=Request.Form("sex")
	certcode=trim(Request.Form("certcode"))
	certclass=Request.Form("certclass")
	marry=trim(Request.Form("marry"))
	corpname=trim(Request.Form("corpname"))
	phone=trim(Request.Form("phone"))
	email=trim(Request.Form("email"))
	address=trim(Request.Form("address"))
	zip=trim(Request.Form("zip"))	
	qq=trim(Request.Form("qq"))	
	website=trim(Request.Form("website"))
	intro=trim(Request.Form("intro"))	
	content=trim(Request.Form("content"))	

	nd=Request.Form("nd")
	yf=Request.Form("yf")
	dd=Request.Form("dd")

	if bz=0 then
		rs.Open "select * from "+tablename+" where userno="&userno,cn,3,3

		rs("realname")=realname
		rs("sex")=sex
		rs("certcode")=certcode
		rs("certclass")=certclass
		rs("marry")=marry
		rs("corpname")=corpname
		rs("phone")=phone
		rs("email")=email
		rs("address")=address
		rs("zip")=zip
		rs("qq")=qq
		rs("website")=website
		rs("intro")=intro
		rs("content")=content
		
		birthday=nd+"-"+yf+"-"+dd
		if IsDate(birthday) then
			rs("birthday")=cdate(birthday)			
		end if
		rs("updatetime")=now()
		rs.Update
		Response.Write("<script language=Javascript>")
		Response.Write("window.location.href='"+backurl+"'")
		Response.Write("</script>")
		
	end if
else
		sqltext="select * from userinfo where userno="&userno
		rs.Open sqltext,cn,1,1
		if not rs.EOF then
			realname=trim(rs("realname"))
			sex=trim(rs("sex"))
			certcode=trim(rs("certcode"))
			certclass=trim(rs("certclass"))
			marry=trim(rs("marry"))
			corpname=trim(rs("corpname"))
			phone=trim(rs("phone"))
			email=trim(rs("email"))
			address=trim(rs("address"))
			zip=trim(rs("zip"))
			qq=trim(rs("qq"))
			website=trim(rs("website"))
			creadate=rs("creadate")
			updatetime=rs("updatetime")
			birthday=rs("birthday")
			nd=year(birthday)
			yf=month(birthday)
			dd=day(birthday)		
			state=rs("state")
			intro=trim(rs("intro"))
			content=trim(rs("content"))
		end if
		mytitle=realname
end if	
%>
<!-- #include file="begin.asp" -->  

<%if bz=1 then%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td valign="top"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="30">
              <tr> 
                <td width="20">&nbsp;</td>
                <td>欢迎光临<%=forumtitle%></td>
                <td width="10">&nbsp;</td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="30"  bgcolor="<%=barcolor%>">
              <tr> 
                <td width="10">&nbsp;</td>
                <td width=30 align=center><img src="images/homeflag.gif"></td>
                <%if classflag="1" then%>
                <td><a href="forum.asp"><%=forumtitle%></a>  &gt; 我的主页 &gt; 基本资料</td>
                <%else%>
                <td><a href="forum_list.asp"><%=forumtitle%></a> &gt; 我的主页 &gt; 基本资料</td>
                <%end if%>
                <td width="100" align="right"></td>
                <td width="10">&nbsp;</td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td height="6"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr bgcolor="<%=titlebgcolor%>"> 
				<td height="26" width=30></td>
                <td width=80 align="center"><b><a href="user_center.asp?userno=<%=userno%>" class=a01><font color=<%=titlecolor%>>我的主页</font></a></b></td>
                <td width=80 align="center"><b><a href="user_myedit.asp?userno=<%=userno%>" class=a01><font color=<%=titlecolor%>>资料修改</font></a></b></td>
                <td width=80 align="center"><b><a href="user_chpass.asp?userno=<%=userno%>" class=a01><font color=<%=titlecolor%>>密码修改</font></a></b></td>
                <td>&nbsp;</td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td height="6"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr bgcolor="<%=titlebgcolor%>"> 
				<td height="26" width=30></td>
                <td align="center"><b><font color=<%=titlecolor%>>基本资料修改</font></b></td>
                <td>&nbsp;</td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="<%=tablecolor%>">
			<form action="<%=myurl%>" method=post name=editform onsubmit="return checkform(editform)" autocomplete = "off">
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>真实姓名:</td>
					<td>&nbsp;
						<input type=text name=realname value="<%=realname%>" size=20 maxlength=20><font color=red size=1>*</font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>性别:</td>
					<td>&nbsp;
						<input type=radio name=sex value="男" <%if sex="男" then Response.Write("checked")%>>男
						<input type=radio name=sex value="女" <%if sex="女" then Response.Write("checked")%>>女
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>出生日期:</td>
					<td>&nbsp;
						<input type=text name=nd size=4 maxlength=4 value="<%=nd%>">年
						<input type=text name=yf size=2 maxlength=2 value="<%=yf%>">月
						<input type=text name=dd size=2 maxlength=2 value="<%=dd%>">日
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>证件号码:</td>
					<td>&nbsp;
						<input type=text name=certcode size=20 maxlength=20 value="<%=certcode%>"><font color=red size=1>*</font>
						<select name="certclass">
							<option value=01 <%if certclass="01" then Response.Write("selected")%>>身份证
							<option value=04 <%if certclass="04" then Response.Write("selected")%>>学生证
							<option value=02 <%if certclass="02" then Response.Write("selected")%>>护照
							<option value=03 <%if certclass="03" then Response.Write("selected")%>>军人证
							<option value=09 <%if certclass="09" then Response.Write("selected")%>>其它
						</select>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>婚姻状况:</td>
					<td>&nbsp;
						<select name="marry"><option value=''>请选择...
							<option value=01 <%if marry="01" then Response.Write("selected")%>>未婚
							<option value=02 <%if marry="02" then Response.Write("selected")%>>已婚
							<option value=03 <%if marry="03" then Response.Write("selected")%>>离异
							<option value=09 <%if marry="09" then Response.Write("selected")%>>保密
						</select>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>联系电话:</td>
					<td>&nbsp;
						<input type=text name=phone size=20 maxlength=40 value="<%=phone%>"><font color=red size=1>*</font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>工作单位:</td>
					<td>&nbsp;
						<input type=text name=corpname size=30 maxlength=50 value="<%=corpname%>">
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>联系地址:</td>
					<td>&nbsp;
						<input type=text name=address size=50 maxlength=50 value="<%=address%>">
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>邮政编码:</td>
					<td>&nbsp;
						<input type=text name=zip size=10 maxlength=6 value="<%=zip%>">
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>电子信箱:</td>
					<td>&nbsp;
						<input type=text name=email size=30 maxlength=60 value="<%=email%>"><font color=red size=1>*</font>
						<font color=993300>请正确填写电子信箱。当您忘记密码时,我们将密码发送到此信箱中</font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>QQ等:</td>
					<td>&nbsp;
						<input type=text name=qq size=50 maxlength=60 value="<%=qq%>">
						<font color=993300>也可填入OICQ或MSN,务请注明</font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>个人主页:</td>
					<td>&nbsp;
						<input type=text name=website size=30 maxlength=60 value="<%=website%>">
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>个人签名:</td>
					<td>
						<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
							<tr><td height=30>
								&nbsp;&nbsp;&nbsp;&nbsp;<font color="#993300">不能超过 250 个字符,文字将出现在您发表的文章的结尾处。</font>
							</td></tr>
							<tr><td>&nbsp;
								<textarea rows=4 cols=50 name=intro style="font-family:宋体"><%=intro%></textarea>
							</td></tr>
							<tr><td height=5></td></tr>
						</table>	
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>个人简介</td>
					<td>
						<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
							<tr><td height=30>
								&nbsp;&nbsp;&nbsp;&nbsp;<font color="#993300">请填写你的爱好、特长、人生观等自我介绍。</font>
							</td></tr>
							<tr><td>&nbsp;
								<textarea rows=8 cols=60 name=content style="font-family:宋体"><%=content%></textarea>
							</td></tr>
							<tr><td height=5></td></tr>
						</table>	
					</td>
				</tr>
                <tr bgcolor="#e4f4e9"> 
					<td height="40" align="center"><br>
					</td>
					<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="submit" name="submit" value="确认更新" style="width:75px; height:24px">
					</td>
				</tr>
              </form>
	        </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td height="15"></td>
              </tr>
            </table>
		  </td>
		</tr>	
 	 </table>
	</td>
  </tr>	
</table>
<!-- #include file="end.asp" -->

<script language=Javascript>

	function checkform(form)
	{
		var flag=true;

		if(form("realname").value==""){alert("请填入姓名!");form("realname").focus();return false;}
		if(form("certcode").value==""){alert("请填入证件号!");form("certcode").focus();return false;}
		if(form("phone").value==""){alert("请填入联系电话!");form("phone").focus();return false;}
		if(form("email").value==""){alert("请填入电子信箱!");form("email").focus();return false;}
		
		return flag;
	}
	
</script>
<%end if%>

⌨️ 快捷键说明

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