reg.asp

来自「紫碟轩留言本V2.0的简单原代码请 查阅」· ASP 代码 · 共 251 行

ASP
251
字号
<!--#include file="conn.asp" -->
<!--#include file="sub.asp" -->
<!--#include file="md5.asp" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=webname%></title>
</head>

<body>
<SCRIPT LANGUAGE="JavaScript">
function changeimage()
		{
			document.form2.showimages.src=document.form2.u_face.value;
		}
</SCRIPT>
<%
if request.QueryString("CS")="A" then
set rst=server.createobject("adodb.recordset")
rst.open "select u_name from zdu where u_name='" &request.form("u_name") &"'",conn,1,1
     If len(request.Form("u_name"))>10 or len(request.Form("u_name"))<4  then 	
	 mgbox"用户名必须在4-10个字符之间,请重新输入"
	 response.End()
	 elseif instr(Request.Form("u_name")," ")>0 then
	 mgbox"用户名不允许包含空格!"
	  response.End()
	  elseif rst.recordcount>0 then
      mgbox"该用户名已经注册,请更换其他用户名!"
	  response.End()
       else
	   mgbox"恭喜!\n\n该用户名可以注册!"
	   response.End()
	   end if
end if
rst.close
set rst=nothing%>
<% 
if request.QueryString("act")="reg" then
set rst=server.createobject("adodb.recordset")
rst.open "select u_name from zdu where u_name='" &request.form("u_name") &"'",conn,1,1
     If len(request.Form("u_name"))>10 or len(request.Form("u_name"))<4  then 	
	 mgbox"用户名必须在4-10个字符之间,请重新输入"
	 response.End()
	 elseif instr(Request.Form("u_name")," ")>0 then
	 mgbox"用户名不允许包含空格!"
	 response.end
	  elseif rst.recordcount>0 then
      mgbox"该用户名已经注册,请更换其他用户名!"
       response.End()
	   end if
 if request.Form("u_pass")="" then 
	 mgbox"请输入密码"
	  response.End()
	  elseif  request.Form("u_pass")<> request.Form("u_pass2") then
   mgbox"两次输入密码不一样 \n\n注意大小写 \n\n请返回重新输入"
   response.End()
   end if
   if request.Form("u_mail")="" then 	
	 mgbox"你还没有填写邮箱哦,请输入邮箱"
	 response.End()
	 elseIf instr(Request.Form("u_mail"),"@")=0 or instr(Request.Form("u_mail"),".")=0  then 	
	 mgbox"邮箱格式不正确 ,请输入正确的格式"
	 response.End()
	 elseif len(request.Form("u_mail"))>50 then
	 mgbox"邮箱地址不能大于50字符"
	 response.End()
	  end if
	 if request.Form("u_qq")<>"" then
	 If Len(request.Form("u_qq"))<5 or Len(request.Form("u_qq"))>9 or Not IsNumeric(request.Form("u_qq"))     then
	mgbox"QQ号码错误:\n\n① QQ号码只能是数字。\n\n② QQ号码不能低于4位数 \n\n③ QQ号码不能高于9位数\n\n④ 如果你没有QQ号码可以不填!"
	 response.End()
	 End If
	end if
	If len(request.Form("u_qm"))>200 then
	mgbox"签名字数请限制在200以内"
	 response.End()
	 end if
	 	If len(request.Form("u_home"))>30 then
	mgbox"个人主页限制在30字符以内"
	 response.End()
	 end if
set rst=server.createobject("adodb.recordset")
rst.open "select * from zdu ",conn,1,3
rst.addnew
rst("u_name")=request.Form("u_name")
rst("u_pass")=MD5(MD5(request.Form("u_pass")))
rst("u_mail")=server.HTMLEncode(request.Form("u_mail"))
rst("u_qq")=request.Form("u_qq")
rst("u_face")=request.Form("u_face")
rst("u_home")=server.HTMLEncode(request.Form("u_home"))
rst("u_qm")=server.HTMLEncode((request.Form("u_qm")))
rst("u_qx")="user"
rst.update
rst.close
set rst=nothing%>
<script>  
alert("恭喜!注册成功,请返回登陆!");  
location.href="index.asp";  
</script>
<%end if%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--页面头部-->
  <tr>
    <td height="30">
    <!--#include file="top.asp" -->    </td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--公告内容-->
  <tr>
    <td width="100%" height="20" valign="middle"></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="0">
  <!--签写留言,分类-->
  <tr valign="middle">
    <td width="10%" bgcolor="#FFCC99"><a href="index.asp">·返回首页</a></td>
    <td width="76%" bgcolor="#FFCC99">&nbsp;</td>
    <td width="14%" bgcolor="#FFCC99" class="putongziti"><b><a href="add.asp"><font color="#FF0000">·签写留言</font></a></b></td>
  </tr>
</table>
<% if request.QueryString("act")="" then%>
<table width="100%" border="0">
  <tr>
    <td align="center"class="dhzi">&nbsp;</td>
  </tr>
  <tr>
    <td width="100%" height="20" align="center" bgcolor="#0099CC"class="dhzi">用户注册协议</td>
  </tr>
  <tr>
    <td height="20"class="dhzi"><table width="98%" border="0" align="center">
      <tr>
        <td><p>服务条款和声明 </p>
          <p><B>继续注册前请先阅读【紫蝶轩室论坛】论坛协议</B> <BR>
            <BR>
            欢迎您加入【紫蝶轩论坛】参加交流和讨论,【紫蝶轩论坛】为公共论坛,为维护网上公共秩序和社会稳定,请您自觉遵守以下条款: <BR>
            <BR>
            一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播下列信息: <BR>
            <BR>
            (一)煽动抗拒、破坏宪法和法律、行政法规实施的;<BR>
            (二)煽动颠覆国家政权,推翻社会主义制度的;<BR>
            (三)煽动分裂国家、破坏国家统一的;<BR>
            (四)煽动民族仇恨、民族歧视,破坏民族团结的;<BR>
            (五)捏造或者歪曲事实,散布谣言,扰乱社会秩序的;<BR>
            (六)宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的;<BR>
            (七)公然侮辱他人或者捏造事实诽谤他人的,或者进行其他恶意攻击的;<BR>
            (八)损害国家机关信誉的;<BR>
            (九)其他违反宪法和法律行政法规的;<BR>
            (十)进行商业广告行为的。 <BR>
            <BR>
          二、互相尊重,对自己的言论和行为负责。 </p></td>
      </tr>
      <tr>
        <td align="center"><form name="form3" method="post" action="?act=ok">
          <input name="Submit232" type="submit"  value="同  意"style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onMouseOut="this.style.color='#eeeeee'" />
                </form>        </td>
        </tr>
    </table></td>
  </tr>
</table>
<% end if
if request.QueryString("act")="ok" then%>
<table width="100%" align="center" cellpadding="0" cellspacing="1">
  <!--循环留言-->
  <tr>
    <td width="100%" align="center"><br />
      <table width="100%" border="0">
        <tr>
          <td width="100%" height="20" align="center" bgcolor="#0099CC"class="dhzi">用户注册</td>
        </tr>
        <tr>
          <td height="20" align="center" valign="top"class="dhzi"><form name="form2" method="post" action="?act=reg">
            <table width="98%" border="0" align="center">
              <tr>
                <td width="23%" align="right">用户名:</td>
                <td width="48%"><input name="u_name" type="text" id="u_name" value="" size="30"></td>
                <td width="29%"><font color="#FF0000">*4-10个字符
                    <input name="Submit222"  type="submit"  value="检测用户名是否存在" onClick="form.action='reg.asp?CS=A'" style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onmouseout="this.style.color='#eeeeee'" />
                </font></td>
              </tr>
              <tr>
                <td align="right">密码:</td>
                <td><input name="u_pass" type="password" id="u_pass" value="" size="33"></td>
                <td><font color="#FF0000">*6-20个字符</font></td>
              </tr>
              <tr>
                <td align="right">密码确认:</td>
                <td><input name="u_pass2" type="password" id="u_pass2" value="" size="33"></td>
                <td><font color="#FF0000">*请再次输入密码确认</font></td>
              </tr>
              <tr>
                <td align="right">E-MAIL:</td>
                <td><input name="u_mail" type="text" id="u_mail" value="" size="30"></td>
                <td><font color="#FF0000">*请输入你常用的邮箱</font></td>
              </tr>
              <tr>
                <td align="right">以下为选填信息</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right" valign="top">用户头像:</td>
                <td valign="top"><select name="u_face" id="u_face" onChange="changeimage();">
                  <option value="images/face/1.gif">头像1</option>
                  <option value="images/face/2.gif" selected="selected">头像2</option>
                  <option value="images/face/3.gif">头像3</option>
                  <option value="images/face/4.gif">头像4</option>
                  <option value="images/face/5.gif">头像5</option>
                  <option value="images/face/6.gif">头像6</option>
                </select>
                  <br />
                  <img src="images/face/2.gif" name="showimages" width="100" height="100" id="showimages" /></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">QQ号码:</td>
                <td><input name="u_qq" type="text" id="u_qq" value="" size="30"></td>
                <td>*请输入你常用的QQ号码</td>
              </tr>
              <tr>
                <td align="right">个人主页:</td>
                <td><input name="u_home" type="text" id="u_home" value="" size="30"></td>
                <td>*输入你的个人主页地址</td>
              </tr>
              <tr>
                <td align="right">个性签名:</td>
                <td><textarea name="u_qm" cols="40" rows="5" id="u_qm"></textarea></td>
                <td valign="bottom">*支持UBB,签名在200字符以内</td>
              </tr>
              <tr>
                <td align="right">&nbsp;</td>
                <td align="left"><input name="Submit23" type="submit"  value="注  册"style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onmouseout="this.style.color='#eeeeee'" />
                  &nbsp;  &nbsp;&nbsp;  &nbsp;  &nbsp;&nbsp; &nbsp;  &nbsp;&nbsp;  &nbsp;  &nbsp;&nbsp; 
                  <input name="Submit22" type="reset"  value="重新填写"style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onMouseOut="this.style.color='#eeeeee'" /></td>
                <td>&nbsp;</td>
              </tr>
            </table>
                    </form>
          </td>
        </tr>
      </table></td></tr>
</table>
<%end if%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--版权-->
  <tr>
    <td width="100%" height="20" > <%call ksmyboot%> </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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