日期:2013-06-06  浏览次数:20744 次

注册的服务器处理页面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 %>
该用户名已被注册,请您重新<a href="login.asp">注册</a>新用户名!
<% response.end
exit do
Else
rs.movenext
end if
loop
Conn.Execute "INSERT INTO author(authorname,password) Values("&name&","&code&")"
RS.Close
Conn.Close %>
<B><% =name %></B> 您已注册成功!<P>
<a href="dispbbs.asp">返回论坛</a>
<a href="bbs_add.asp">我要发言</a>