顺便问一句,怎么可以获取当前登陆的用户名。?
<%
on error resume next
a=trim(request.form("zhh"))
b=trim(request.form("mm"))
c=trim(request.form("xm"))
d=trim(request.form("xb"))
e=trim(request.form("ly"))
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("db1.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
commandtext="select * from t_user where d_user='"&a&"'"
set rs=conn.execute(commandtext,,adcmdtext)
if rs.eof then
commandtext="Insert into t_user(d_user,d_pass,d_name,d_sex,d_liuyan) VALUES('"&a&"','"&b&"','"&c&"','"&d&"','"&e&"')"
conn.Execute commandtext,,adcmdtext
if errs.count=0 then
response.write"<P>注册成功!</p>"
response.write"<a href=top.htm>返回首页</a>"
end if
else
response.write"<P>该用户名已经被注册过了,请选择新的用户名!</P>"
response.write"<a href=zhc.asp>注册页面</a>"
end if
set conn=nothing
%>