📄 sqb.asp
字号:
<%
dim WINNT_CHINESE
function strLength(str)
ON ERROR RESUME NEXT
dim WINNT_CHINESE
WINNT_CHINESE = (len("用户")=2)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strLength=t
else
strLength=len(str)
end if
if err.number<>0 then err.clear
end function
dim rs,sql
dim nickname,passwd
if request("action")="save" then
if request("nickname")="" then
Response.write "<script>alert('昵称是必须填写的!');history.back();</script>"
Response.end
else
nickname=trim(request.form("nickname"))
end if
if request("passwd")="" then
Response.write "<script>alert('密码是必须填写的!');history.back();</script>"
Response.end
elseif request("passwd2")="" then
Response.write "<script>alert('验证密码是必须填写的!');history.back();</script>"
Response.end
elseif request("passwd")<>request("passwd2") then
Response.write "<script>alert('密码和验证密码必须是一样的!');history.back();</script>"
Response.end
else
passwd=trim(request.form("passwd"))
end if
if request("email")<>"" then
if instr(request("email"),"@")<1 or instr(request("email"),".")<1 then
Response.write "<script>alert('请填写正确的EMAIL地址!');history.back();</script>"
Response.end
end if
end if
if request("web")<>"" then
if instr(request("web"),"http://")<1 or instr(request("web"),".")<1 then
Response.write "<script>alert('请填写正确的网站地址!');history.back();</script>"
Response.end
end if
end if
if request("soft")<>"" then
if strLength(trim(request("soft")))>50 then
Response.write "<script>alert('常用软件不能超过50个字符!');history.back();</script>"
Response.end
end if
end if
if request("techang")<>"" then
if strLength(trim(request("techang")))>50 then
Response.write "<script>alert('个人特长不能超过50个字符!');history.back();</script>"
Response.end
end if
end if
if request("oicq")<>"" then
if not isnumeric(trim(request("oicq"))) then
Response.write "<script>alert('oicq是由数字组成的!');history.back();</script>"
Response.end
end if
end if
%>
<!-- #include file="conn.asp" -->
<% dim srday
srday=request.Form("i1")&"-"&request.Form("i2")&"-"&request.Form("i3")
set rs=server.createobject("adodb.recordset")
sql = "select * from [user] where nickname='"&nickname&"'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
Response.write "<script>alert('【"&nickname&"】昵称已经被别人注册了,请另外选择一个昵称!');history.back();</script>"
Response.end
end if
rs.close
sql = "select * from [user] where (userid is null)"
rs.open sql,conn,1,3
rs.addnew
if request("username")<>"" then
rs("username")=trim(request.Form("username"))
end if
rs("nickname")=nickname
rs("passwd")=passwd
if request("email")<>"" then
rs("email")=trim(request.Form("email"))
end if
if request("sex")=1 then
rs("sex")=true
end if
if isdate(srday) then
rs("shengri")=srday
end if
if request("web")<>"" then
rs("url")=trim(request.Form("web"))
end if
if request("oicq")<>"" then
rs("oicq")=trim(request.Form("oicq"))
end if
if request("soft")<>"" then
rs("soft")=trim(request.Form("soft"))
end if
if request("techang")<>"" then
rs("techang")=trim(request.Form("techang"))
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect "login.asp"
else
%>
<html>
<head>
<title>用户注册页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="FORUM.CSS" type="text/css">
</head><body>
<table width="80%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6699FF">
<tr>
<td height="21" bgcolor="#99CCFF">
<div align="center"><font face="楷体_GB2312" size="+2"><img src="upfile/map/JJCBAR.GIF" width="468" height="60"></font></div>
</td>
</tr>
<tr>
<td bgcolor="#FFCC00"> <p align="center"><font face="楷体_GB2312"><b><font face="宋体">用户注册页</font></b></font></p>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<form name="form1" method="post" action="sqb.asp?action=save">
<table width="90%" border="0" cellspacing="1" cellpadding="3" align="center">
<tr align="center">
<td colspan="2" bgcolor="#FFCCFF">【基础资料】 </td>
</tr>
<tr>
<td align="right" bgcolor="#eeeeee">常用昵称:</td>
<td width="68%" bgcolor="#FFFFFF"><input type="text" name="nickname" class="buttonface" size="20">
<b><font color="#FF0000"> *</font></b> 必须填写</td>
</tr>
<tr>
<td align="right" bgcolor="#eeeeee">真实姓名:</td>
<td width="68%" bgcolor="#FFFFFF"><input name="uesrname" type="text" class="buttonface" id="uesrname" size="20">
<b></b></td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">登陆密码: </td>
<td width="68%" bgcolor="#FFFFFF"><input type="password" name="passwd" size="20" class="buttonface">
<b><font color="#FF0000"> *</font></b> 必须填写</td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">验证密码:</td>
<td bgcolor="#FFFFFF"><input type="password" name="passwd2" size="20" class="buttonface">
<b><font color="#FF0000"> *</font></b> 必须填写</td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">性别:</td>
<td bgcolor="#FFFFFF">
<input name="sex" type="radio" class="box" value="1" checked>
男
<input name="sex" type="radio" class="box" value="0">
女</td>
</tr>
<tr align="center" bgcolor="#FFCCFF">
<td colspan="2">【附加资料】</td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">出生年月:</td>
<td bgcolor="#FFFFFF"><select name="year" id="year">
<option value="" selected>年</option>
<% for i1=1960 to 2000 %>
<option value="<%=i1%>"><%=i1%></option>
<% next %>
</select>
<select name="month" id="month">
<option value="" selected>月</option>
<% for i2=1 to 12 %>
<option value="<%=i2%>"><%=i2%></option>
<% next %>
</select>
<select name="day" id="day">
<option value="" selected>日</option>
<% for i3=1 to 31 %>
<option value="<%=i3%>"><%=i3%></option>
<% next %>
</select></td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">联系信箱:</td>
<td bgcolor="#FFFFFF"><input name="email" type="text" class="buttonface" id="email2" size="40"></td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">OICQ:</td>
<td bgcolor="#FFFFFF"><input name="oicq" type="text" class="buttonface" id="oicq" size="20"></td>
</tr>
<tr>
<td width="32%" align="right" bgcolor="#eeeeee">个人主页:</td>
<td bgcolor="#FFFFFF"><input name="web" type="text" class="buttonface" id="web" size="40">
<br>
(请使用<font color="#FF0000">http://www.wlong3d.com</font>的形式填写) </td>
</tr>
<tr>
<td align="right" bgcolor="#eeeeee">常用软件:</td>
<td bgcolor="#FFFFFF"><input name="soft" type="text" class="buttonface" id="soft" size="40">
<font color="#FF0000">(限50字内)</font> </td>
</tr>
<tr>
<td align="right" bgcolor="#eeeeee">个人特长:</td>
<td bgcolor="#FFFFFF"><input name="techang" type="text" class="buttonface" id="techang" size="40">
<font color="#FF0000">(限50字内)</font></td>
</tr>
<tr>
<td colspan="2" bgcolor="#99CCFF"> <div align="center">
<input type="submit" name="Submit3" value="提交申请" onClick="MM_validateForm('姓名','','R','昵称','','R','year','','NisNum','icq','','NisNum','oicq','','NisNum','email','','RisEmail','tel','','NisNum','shouji','','NisNum','bp','','NisNum','soft','','R','techang','','R','密码','','R');return document.MM_returnValue" class="buttonface">
<input type="reset" name="Submit4" value="重新填写" class="buttonface">
</div>
<div align="center"> </div></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="11" bgcolor="#FFCC00">
<div align="center"> </div>
<p align="center">版权所有 ©2003-2006 www.wlong3d.com</p>
<p align="center"><a href="mailto:wlong88@yeah.net">wlong88@yeah.net</a></p>
</td>
</tr>
</table>
</body>
</html>
<% end if %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -