userregup.asp

来自「科研及设备管理系统是一个基于WEB的网络管理信息系统」· ASP 代码 · 共 50 行

ASP
50
字号
<%
	dim pathlevel,username,passowrd,rs,sql,updatesql
	pathlevel="../"
%>
<!--#include file="../share/checkinput.asp" -->
<!--#include file="../database/conn.asp" -->
<!--#include file="../share/md5.asp" -->
<%
	username=trim(request.Form("username"))
	password1=trim(request.Form("password1"))
	password2=trim(request.Form("password2"))

	if username="" then
		response.Redirect("userreg.asp?ec=1")
	end if
	if password1="" then
		response.Redirect("userreg.asp?ec=2")
	end if
	if password2="" then
		response.Redirect("userreg.asp?ec=3")
	end if
	
	call checkinput(username&password1&password2)
	
	if password1<>password2 then
		response.Redirect("userreg.asp?ec=4")
	end if
	
	set rs=server.CreateObject("adodb.recordset")
	sql="select top 1 username from userinfo where username='"&username&"'"
	rs.open sql,cn,1,3
	if not rs.eof then
		response.redirect("userreg.asp?ec=5")
	else
		password=MD5(password1)
		rs.close
		sql="select * from userinfo where u_id is null"
		rs.open sql,cn,1,3
		rs.addnew
		rs("username")=username
		rs("password")=password
		rs("state")=1
		rs.update
	end if
	rs.close
	set rs=nothing
	cn.close
	set cn=nothing
	response.Redirect("userlogin.asp?ec=10")
%>

⌨️ 快捷键说明

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