28,391
社区成员
发帖
与我相关
我的任务
分享
<!--#include file="conn.asp"-->
<html>
<head>
<title>验证 </title>
</head>
<body>
<%
dim username,userPassword,email
username = Trim(request("username"))
password = Trim(request("password"))
email = Trim(request("email"))
If(username="" or password="" or email="") Then
response.write " <script>alert(""用户名或密码或邮箱不能为空!""); </script>"
response.write " <script>history.go(-1); </script>"
response.end
else
If Request("Submitted") = "login.asp" Then
strsql="select * from user where user_name='" & username & "'"
strsql=strsql & " and user_pasw='" & password & "'"
strsql=strsql & " and user_email='" & email & "'"
set conn=server.CreateObject("adodb.connection")
conn.open "mydata"
set rs = CreateObject("ADODB.RecordSet")
rs.Open strsql,conn,1,3
if not (rs.eof and rs.eof) then
response.Write("用户名已经存在")
'response.Redirect("index.asp")
response.End
else
rs.AddNew
rs("user_name")= username
rs("user_pasw")= password
rs("user_email")= email
rs.update
response.Write("用户添加成功!")
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
end if
%>
</body>
</html>