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

📄 guest_register.asp

📁 留言簿功能所用的源码,功能比较强大,所用数据库关联比较多
💻 ASP
字号:
<!--#INCLUDE FILE="config.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if request.Form<>"" then%>
<meta http-equiv="refresh" content="2;<%if session("list")=0 then%>url=default.asp<%else%>url=default1.asp<%end if%>">
<%end if%>
<title>注册新用户名</title>
<link href="1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body onkeydown="if(event.keyCode==13 && event.ctrlKey) if(save_onclick())document.form.submit()">
<table border=0 width=700 align=center>
  <tr> 
    <td align=center> 
      <!--#INCLUDE FILE="top.asp"-->
  </tr>
  <tr> 
    <td align=center><hr size=1 width=100% noshade color=#C0C0C0></tr>
</table>
<%
if request.Form<>"" then
     UserName      =Request.Form("UserName")
	 password=request.Form("password")
	 Email      =Request.Form("Email")
     HomePage      =Trim(Request.Form("HomePage"))
	 qq=request.Form("QQ")
	 sex   	   =Request.Form("sex")
     Face          =Request.Form("Face")
	 if homepage="http://" then homepage=""
      Set rs=server.createobject("ADODB.RECORDSET")
	  rs.open "Select * From register where username='" & request("username")& "'",Conn,3,3
	  if rs.eof then
	  sql="Insert Into register (username,password,mail,homepage,face,sex,qq)  Values('"& UserName&"','"& password&"','"&email&"','"&homepage&"','"&face&"','"&sex&"','"&qq&"')"
	  conn.Execute sql
cookiePath=request.servervariables("path_info")
cookiePath=left(cookiePath,instrRev(cookiePath,"/"))
response.cookies("ly").Path=cookiePath
response.cookies("ly")("useridname")=username
response.cookies("ly")("useridpassword")=password
      else
	  response.Redirect "error.asp?type=usrname"
	  end if
		response.Redirect "post_ok.asp?info=注册成功!"
	 rs.close
	 set rs=nothing
conn.close
set conn=nothing
response.end
end if
%>
<table border=0 width=100% align=center>
  <tr>
    <td width="3%" align=lift><font color="#FF0000">&nbsp;</font></td>
    <td width="8%" align=lift><a href="<%if session("list")=0 then%>default.asp<%else%>default1.asp<%end if%>">留言首页</a></td>
    <td width="89%" align=right>
      <!--#INCLUDE FILE="link.asp"-->
    </td>
</table>
<SCRIPT language=javascript>
function  save_onclick()
{
  var strTemp = document.form.UserName.value;
  if (strTemp.length == 0 )
  {
      alert("请输入用户名!");
      document.form.UserName.focus();
      return false;
  }
  var strTemp = document.form.password.value;
  if (strTemp.length == 0 )
  {
      alert("请输入密码!");
      document.form.password.focus();
      return false;
  }
  var strTemp =document.form.password.value;
  var strTemp1 =document.form.password2.value;
  if (strTemp!=strTemp1)
  {
      alert("两次输入密码不一致!");
      document.form.password.focus();
      return false;
  }
  return true;  
}
</SCRIPT>
<form action="" method="POST" name="form" id="form" onsubmit="return save_onclick()">
  <input type="hidden" name="form" value="SaveData">
  <input type="hidden" name="D_Date" value="<%=cstr(now())%>">
  <div align="center">
  <table width="900" border="1" cellpadding="5" cellspacing="1" bgcolor="#E6F2FF" style="border-collapse: collapse" bordercolor="#000000" >
    <tr >
      <td colspan="2" bordercolorlight="#000000" bordercolordark="#C0C0C0">
        <p align="center"><strong style="font-weight: 400">注册新用户名</strong>        </td>
    </tr>
    <tr>
      <td colspan="2" bordercolorlight="#000000" bordercolordark="#C0C0C0" class="table001"><div align="center">本留言板不注册也可发言,注册后保留用户名,须输入密码方可发言。带*的为必填项。</div></td>
    </tr>
    <tr >
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">用户名(<span class="style1"><font color="#000000">*</font></span>):<br>
        </strong>注册用户名长度限制为0-10字符</div></td>
      <td height="28" align="center" width="614"><div align="left"><font color="#00FF00">
        <input name="UserName" class="input1" id="UserName" size="30" maxlength="10"></font> </div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">性别:<br>
      </strong>请选择您的性别</div></td>
      <td height="28" align="center" width="614"><div align="left"><font color="#FFFFFF">
        <select name="sex" size="1" id="select4">
          <option value="1" selected>男</option>
          <option value="0">女</option>
        </select></font> </div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">密码(<span class="style1"><font color="#000000">*</font></span>):<br>
      </strong>请输入密码,区分大小写 </div></td>
      <td height="28" align="center" width="614"><div align="left">
        <input name="password" type="password" id="password" size="30" class="input1">
      </div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">重复密码(<span class="style1"><font color="#000000">*</font></span>):<br>
      </strong>请再输一遍确认 </div></td>
      <td height="28" align="center" width="614"><div align="left">
        <input name="password2" type="password" id="password23" size="30" class="input1">
      </div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">电子邮件:</strong></div></td>
      <td height="28" align="center" width="614"><div align="left"><font color="#00FF00">
          <input name="Email" size="30" class="input1">
      </font></div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">个人主页:</strong></div></td>
      <td height="28" align="center" width="614"><div align="left"><font color="#00FF00">
          <input name="HomePage" size="30" Value="http://" class="input1">
      </font></div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">QQ:</strong></div></td>
      <td height="28" align="center" width="614"><div align="left"><font color="#00FF00">
        <input name="QQ" class="input1" id="QQ3" size="30">
      </font></div></td>
    </tr>
    <tr class="table001">
      <td width="260" align="center"><div align="left">
		<strong style="font-weight: 400">头像:</strong></div></td>
      <td height="28" align="center" valign="top" width="614"><div align="left">
        <table width="100%"  border="0">
          <tr>
            <td width="9%"><select name="face" size="1" id="select5" onChange="document.all.idface.src=options[selectedIndex].value;">
              <option value="face/1.gif" selected>1</option>
              <option value="face/2.gif">2</option>
              <option value="face/3.gif">3</option>
              <option value="face/4.gif">4</option>
              <option value="face/5.gif">5</option>
              <option value="face/6.gif">6</option>
              <option value="face/7.gif">7</option>
              <option value="face/8.gif">8</option>
              <option value="face/9.gif">9</option>
              <option value="face/10.gif">10</option>
              <option value="face/11.gif">11</option>
              <option value="face/12.gif">12</option>
              <option value="face/13.gif">13</option>
              <option value="face/14.gif">14</option>
              <option value="face/15.gif">15</option>
              <option value="face/16.gif">16</option>
              <option value="face/17.gif">17</option>
              <option value="face/18.gif">18</option>
              <option value="face/19.gif">19</option>
              <option value="face/20.gif">20</option>
              <option value="face/21.gif">21</option>
              <option value="face/22.gif">22</option>
              <option value="face/23.gif">23</option>
              <option value="face/24.gif">24</option>
              <option value="face/25.gif">25</option>
              <option value="face/26.gif">26</option>
              <option value="face/27.gif">27</option>
              <option value="face/28.gif">28</option>
              <option value="face/29.gif">29</option>
              <option value="face/30.gif">30</option>
              <option value="face/31.gif">31</option>
              <option value="face/32.gif">32</option>
              <option value="face/33.gif">33</option>
              <option value="face/34.gif">34</option>
              <option value="face/35.gif">35</option>
              <option value="face/36.gif">36</option>
              <option value="face/37.gif">37</option>
              <option value="face/38.gif">38</option>
              <option value="face/39.gif">39</option>
              <option value="face/40.gif">40</option>
              <option value="face/41.gif">41</option>
              <option value="face/42.gif">42</option>
              <option value="face/43.gif">43</option>
              <option value="face/44.gif">44</option>
              <option value="face/45.gif">45</option>
              <option value="face/46.gif">46</option>
              <option value="face/47.gif">47</option>
              <option value="face/48.gif">48</option>
              <option value="face/49.gif">49</option>
              <option value="face/50.gif">50</option>
              <option value="face/51.gif">51</option>
              <option value="face/52.gif">52</option>
              <option value="face/53.gif">53</option>
              <option value="face/54.gif">54</option>
              <option value="face/55.gif">55</option>
              <option value="face/56.gif">56</option>
            </select></td>
            <td width="11%"><img src="face/1.gif" width="72" height="122" align="left" id=idface ></td>
            <td width="80%"> </td>
          </tr>
        </table>
</div>        </td>
    </tr>
    <tr class="table001">
      <td height="28" colspan="2" align="center"><input name="join" type="submit" class="input2" id="join2" value=" 提 交 " >
 
  <input name="B12" type="reset" class="input2" id="B122"  value=" 重 写 "  >
</td>
    </tr>
  </table>
  </div>
  <table border=0 width=700 align=center>
    <tr> 
      <td height=12><HR SIZE=1 WIDTH=100% NOSHADE COLOR=#C0C0C0></td>
    </tr>
    <tr> 
      <td align=center> 
        <!--#INCLUDE FILE="bottom.asp"-->
    </tr>
  </table>
  <p> </p>
</form>
</body>
</html>

⌨️ 快捷键说明

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