username=request.form("name")
password1=request.form("password1")
password2=request.form("password2")
email=request.form("email")
if username="" then
response.write"用户名不能为空"
%>
<a href=javascript:history.back()>上一页</a>
<%
response.end
end if
if password1<>password2 then
response.write"两次输入的密码不一样"
%>
<a href=javascript:history.back()>上一页</a>
<%
response.end
else
password=password1
end if
if email="" then
response.write"电子邮件不能为空"
%>
<a href=javascript:history.back()>上一页</a>
<%
response.end
end if
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
conn.Open connstr
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where (user.username='"&username&"')"
rs.open sql,conn,3,1
if not rs.eof then
response.write"以有人使用此用户名 请更换"
%>
<a href=javascript:history.back()>上一页</a>
<%
else
sql="insert into user(username,password,email) values('"&username&"','"&password&"','"&eamil&"')"
rs.open sql,conn,3,1
response.write"注册成功"