也各简单的bbs(二)

发表于:2007-06-30来源:作者:点击数: 标签:
注册的 服务器 处理页面reg.asp: % response.buffer=true dim name name=‘’quot;name)quot;‘’ code=‘’quot;password)quot;‘’ Set conn = Server.CreateObject(ADODB.Connection) DBPath = Server.MapPath(author.mdb) conn.Open driver={Microsoft Ac
注册的服务器处理页面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 Aclearcase/" target="_blank" >ccess 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>

原文转自:http://www.ltesting.net