📄 regsave.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
if request.form("user")="" then
response.write"<script language=javascript>alert('用户名必须填写');this.location.href='reg.asp';</script>"
response.end
end if
if request.form("pass")="" then
response.write"<script language=javascript>alert('密码必须填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("pass")<>request.form("conpass") then
response.write"<script language=javascript>alert('确认密码与原密码不一致');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("truename")="" then
response.write"<script language=javascript>alert('真实姓名请您填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("phone")="" then
response.write"<script language=javascript>alert('电话号码请您填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("email")="" then
response.write"<script language=javascript>alert('E-mail请您填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("post")="" then
response.write"<script language=javascript>alert('邮编请您填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
if request.form("address")="" then
response.write"<script language=javascript>alert('地址请您填写');this.location.href='javascript:history.go(-1)';</script>"
response.end
end if
username=trim(request.form("user"))
set rs=server.createobject("adodb.recordset")
sql="select * from member where cname='"&username&"'"
rs.open sql,conn,3,3
if not rs.eof then
response.write"<script language=javascript>alert('已经存在此用户名,请重新选择一个');this.location.href='javascript:history.go(-1)';</script>"
else
rs.addnew
rs("cname")=trim(request("user"))
rs("password")=md5(trim(request("pass")))
rs("truename")=trim(request("truename"))
rs("phone")=trim(request("phone"))
rs("email")=trim(request("email"))
rs("post")=trim(request("post"))
rs("address")=trim(request("address"))
rs("regtime")=now()
rs("ip")=request.servervariables("remote_addr")
rs.update
response.write"<script language=javascript>alert('用户注册成功');this.location.href='index.asp';</script>"
session("user")=username
end if
rs.close
set rs=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -