请教asp登陆问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 01:08:02
<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="subs.asp" -->
<!--#INCLUDE FILE="md5.asp" -->
<%
conlen=request.servervariables("content_length")
if conlen=0 then
response.write "Error content length!"
response.end
end if

userid=request.form("uid")
userpwd=request.form("pwd")
userpwd=md5(userpwd)
Set rs = Server.CreateObject("ADODB.Recordset")
StrSQL = "Select * from info where name='"&userid&"'"
rs.open StrSQL,conn,3,3

if rs.EOF then
message "错误的用户名!请<a href=javascript:history.back()>返回</a>!或者在此<a href=zhuce.asp>注册</a>!"
rs.close
set rs=nothing
response.end
end if

if rs("psw")<>userpwd then
message "密码错误!请重新<a href=javascript:history.back()>登陆</a>!"

<!--#include file="Connections/web.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("u"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="hyzx.asp"
MM_redirectLoginFailed="errro.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_web_STRING
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.usertable WHERE userna