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

📄 regpost.asp

📁 学生评教系统,可以实现学生评教,教师查分功能.
💻 ASP
字号:

<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/email.asp"-->
<head>
<title>用户注册</title>
<LINK href="forum.css" rel=stylesheet>
</head>
<script language="JavaScript">
function shutwin()
{window.close();
return;
}
</script>
<body bgcolor="<%=Tablebodycolor%>" alink="#333333" vlink="#333333" link="#333333">
<%
	dim username
	dim sex
	dim pass1
	dim pass2
	dim password
	dim useremail
	dim face,width,height
	dim oicq
	dim sign
	dim rs,sql
	dim founderr
	dim errmsg
	dim boardtype
	founderr=false

	call chkinput
sub chkinput()
	if request("name")="" then
		errmsg=errmsg+"<br>"+"<li>请输入您的用户名。"
		founderr=true
	else
		username=trim(request("name"))
	end if
	if request("sex")="" then
		errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
		founderr=true
	elseif request("sex")=0 or request("sex")=1 then
		sex=request("sex")
	else
		errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
		founderr=true
	end if
	if request("psw")="" then
		errmsg=errmsg+"<br>"+"<li>请输入您的密码。"
		founderr=true
	else
		pass1=request("psw")
	end if
	if request("pswc")="" then
		errmsg=errmsg+"<br>"+"<li>请输入确认密码。"
		founderr=true
	else
		pass2=request("pswc")
	end if
	if pass1<>pass2 then
		errmsg=errmsg+"<br>"+"<li>您输入的密码和确认密码不一致。"
		founderr=true
	else
		password=pass2
	end if
	if IsValidEmail(trim(request("e_mail")))=false then
   		errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
   		founderr=true
	else
		useremail=trim(request("e_mail"))
	end if
	if request("myface")<>"" then
		if request("width")="" or request("height")="" then
			errmsg=errmsg+"<br>"+"<li>请输入图片的宽度和高度。"
			founderr=true
		elseif not isInteger(request("width")) or not isInteger(request("height")) then
			errmsg=errmsg+"<br>"+"<li>您输入的字符不合法。"
			founderr=true
		elseif request("width")<20 or request("width")>80 then
			errmsg=errmsg+"<br>"+"<li>您输入的图片宽度不符合标准。"
			founderr=true
		elseif request("height")<20 or request("height")>80 then
			errmsg=errmsg+"<br>"+"<li>您输入的图片高度不符合标准。"
			founderr=true
		else
			face=request("myface")
			width=request("width")
			height=request("height")
		end if
	else
		if request("face")="" then
			errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
			founderr=true
		elseif Instr(request("face"),picurl)>0 then
			face=request("face")
			width=32
			height=32
		else
			errmsg=errmsg+"<br>"+"<li>您选择了错误的头像。"
			founderr=true
		end if
	end if
	if request("oicq")<>"" then
		if chkoicq(request("oicq"))=false then
			errmsg=errmsg+"<br>"+"<li>Oicq号码只能是4-10位数字,您可以选择不输入。"
			founderr=true
		end if
	end if
end sub

sub saveuserinfo()

	set rs=server.createobject("adodb.recordset")
	sql="select * from [user] where username='"&username&"'"
	rs.open sql,conn,1,3
	if not rs.eof and not rs.bof or username="动网小精灵" then
		errmsg=errmsg+"<br>"+"<li>对不起,您输入的用户名已经被注册,请重新输入。"
		founderr=true
	else
		rs.addnew
		rs("username")=username
		rs("userpassword")=password
		rs("useremail")=useremail
		rs("userclass")="新手上路"
		if request("Signature")<>"" then
		rs("sign")=trim(request("Signature"))
		end if
		if request("oicq")<>"" then
		rs("oicq")=request("oicq")
		end if
        	Rs("article")=0
        	Rs("sex")=sex
        	Rs("addDate")=NOW()
		rs("face")=face
        	Rs("width")=width
        	Rs("height")=height
		rs("logins")=1
        	Rs("lastlogin")=NOW()
		rs.update
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
end sub

if founderr=true then
	call error()
else
	call saveuserinfo()
	if founderr=true then
		call error()
	else
%>
<br>
<br>
<table cellpadding=0 cellspacing=0 border=0 width=305 bgcolor=<%=aTablebackcolor%> align=center>
        <tr>
            <td width="307">
                <table cellpadding=3 cellspacing=1 border=0 width=307>
  <TBODY>
  <TR align=middle bgcolor=<%=aTabletitlecolor%>>
    <TD colSpan=2 height=24 width="295"><b>用户注册成功</b></TD></TR>
 
 
 <TR bgcolor=<%=Tablebodycolor%>>
    <TD colspan=2 width="295"><center><b>
    </center></b></center>
    </TD></TR>
   <TR bgcolor=<%=Tablebodycolor%>>
    <TD width=104 align="right">注册名:</TD>
    <TD width="181"><%=htmlencode(username)%></TD></TR>
  <TR bgcolor=<%=Tablebodycolor%>>
    <TD width=104 align="right">密码:</TD>
    <TD width="181"><%=htmlencode(password)%>
    </TD></TR>
  <TR bgcolor=<%=Tablebodycolor%>>
    <TD width=104 height=32 align="right">Email地址:</TD>
    <TD height=32 width="181"><%=useremail%></TD></TR>
  <TR bgcolor=<%=Tablebodycolor%>>
    <TD width=104 align="right">签 名 档: </TD>
    <TD width="181"><%if trim(request("Signature"))="" then%>未填写<%else%><%=trim(request("Signature"))%><%end if%>
    </TD></TR>
  <TR align=middle bgcolor=<%=aTabletitlecolor%>>
    <TD colSpan=2 width="295">
<DIV align=center><a href="javascript:shutwin();"class="p9">关闭窗口</a></DIV></TD></TR></TBODY></TABLE></td></tr></table>
<%
	end if
end if
%>
<p align=center><%=ads2%>
<%=Copyright%>  <%=Version%>
</p>
</body>

⌨️ 快捷键说明

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