28,409
社区成员




<!--#include file="conn.asp" -->
<%
dim rs
dim u_name
dim u_passwds
u_name = trim(request("name"))
u_passwd = trim(request("passwd")) '这里是passwd还是pass
if u_name="" then
%>
<script language=javascript>
alert("帐号为空");
location.href="login.asp"
</script>
<%
end if
if u_passwd="" then
%>
<script language=javascript>
alert("密码为空");
location.href="login.asp"
</script>
<%
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from [reg] where [name]='"&u_name&"'",conn,1,3
if not (rs.eof and rs.bof) then
if u_passwd = trim(rs("u_passwd")) then '这里是u_passwd,并加trim
session("u_name")= u_name '这里是u_name
Response.write(" <script>location.href('index.asp')</script>" )
else
response.write (" <script>alert('用户密码错误');location.href('login.asp') </script>")
end if
else
response.write (" <script>alert('用户帐号错误');location.href('login.asp') </script>")
end if
rs.close
set rs=nothing
%>