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

📄 reg_adduser.asp

📁 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会
💻 ASP
字号:
<%@ Language=VBScript %>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="init.inc" -->
<%
mystep=Request.QueryString("mystep")
set cn = Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")

myurl="reg_adduser.asp?mystep="+mystep
bz=1
if Request.ServerVariables("REQUEST_METHOD")="POST" then
	usercode=trim(Request.Form("usercode"))
	sqltext="select userno from userinfo where usercode='"+usercode+"'"
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		bz=0
		rs.Close
		Response.Redirect("reg_usercode.asp?errflag=1&usercode="+usercode)
	else				
		rs.Close
		if mystep="2" then
			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"))	
			userpass=trim(Request.Form("userpass"))

			nd=Request.Form("nd")
			yf=Request.Form("yf")
			dd=Request.Form("dd")
			
			rs.Open "select top 1 *  from userinfo",cn,1,3
			rs.AddNew			
			rs("usercode")=username
			keyno=syskeyno("userinfo","userno")
			rs("userno")=keyno

			rs("usercode")=usercode
			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
			rs("userpass")=userpass
		
			birthday=nd+"-"+yf+"-"+dd
			if IsDate(birthday) then
				rs("birthday")=cdate(birthday)			
			end if
			rs("creadate")=now()
			rs("updatetime")=now()
			rs("logintime")=now()
			rs("logincount")=1
			rs("ipaddress")=Request.ServerVariables("Remote_HOST")
			
			rs("state")=newuserstate
			rs("querycount")=0
			rs("talkcount")=0
			rs("picflag")="0"
			rs("flag")="0"
			rs("grade")=0
			rs("amount")=0
			rs("notifyflag")="0"
			rs("openflag")="1"
			rs("openflag2")="0"
			rs.Update
			
			vflag=2
			
			if newuserstate="1" then
				Session("userno")=keyno
				Session("usercode")=usercode
				gotourl="user_center.asp"
			else	
				gotourl="user_login.asp"
			end if	

			Response.Redirect gotourl
			'Response.Write("<script language=Javascript>")
			'Response.Write("window.location.href='"+gotourl+"';")
			'Response.Write("window.close();")
			'Response.Write("</script>")
		else
			sex="男"
			myurl="reg_adduser.asp?mystep=2"
		end if	
	end if
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="96%" 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="96%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="<%=tablecolor%>">
			<form action="<%=myurl%>" method=post name=editform onsubmit="return checkform(editform)" autocomplete = "off">
				<input type=hidden name=usercode value='<%=usercode%>'>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>会员代号:</td>
					<td>&nbsp;
						<font color=ff0000><b><%=usercode%></b></font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>新 密 码:</td>
					<td>&nbsp;
						<input type=password name=userpass size=20 value='<%=userpass%>' maxlength=20><font color=red size=1>*</font>
						<font color="#993300">建议密码由字母与数字混合组成,长度不少于6位。</font>
					</td>
				</tr>
				<tr bgcolor="#ffffff"> 
 					<td width=120 height=30 align=center>确认密码:</td>
					<td>&nbsp;
						<input type=password name=userpass2 size=20 value='<%=userpass%>' maxlength=20>
						<font color="#993300">确认上面输入的密码。</font>
					</td>
				</tr>
				<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" -->
<!-- #include file="sysfunc.inc" -->

<script language=Javascript>

	function checkform(form)
	{
		var flag=true;

		if(form("userpass").value==""){alert("密码不能为空!");form("userpass").focus();return false;}
		if(form("userpass2").value!=form("userpass").value){alert("两次密码不一致!");
			form("userpass").value="";	form("userpass2").value="";form("userpass").focus();return false;}
		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;
	}


	function checkemail(email)
	{	
	
		if (email.search("@")==-1)
		{
			window.alert("您填写的电子信箱格式不正确");
			return false;
		}	  
		return true;
	}
	
</script>
<%end if%>

⌨️ 快捷键说明

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