注册的服务器处理页面reg.asp:
<%
response.buffer=true
dim name
name="'"&REQUEST.FORM("name")&"'"
code="'"&rEQUEST.FORM("password")&"'"
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("author.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
sql="SELECT * FROM author "
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
do while not rs.eof
if rs("authorname")=name then %>
该用户名已被注册,请您重新
注册新用户名!
<% response.end
exit do
Else
rs.movenext
end if
loop
Conn.Execute "INSERT INTO author(authorname,password) Values("&name&","&code&")"
RS.Close
Conn.Close %>
<% =name %> 您已注册成功!
返回论坛
我要发言