我的管理员登陆提供给你看看。。。
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
dim lUserName,lUserPass
lUserName=request.form("UserName")
lUserPass=request.form("UserPass")
ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If ip = "" Then ip = Request.ServerVariables("REMOTE_ADDR")
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select * from admin where UserName='" &lUserName& "' and UserPass='"&md5(lUserPass)&"'",conn,1,3
if rs.eof and rs.bof then
set rs2=server.createobject("adodb.recordset")
rs2.Open "Select * From rizhi Where 1=0",conn,1,3
rs2.AddNew
rs2("UserName")=lUserName
rs2("UserPass")=lUserPass
rs2("addtime")=Now()
rs2("ip")=ip
rs2("itype")=0
rs2.Update
rs2.Close
set rs2 = nothing
response.write ("<script language=javascript> alert('用户名或密码错误!\n\n阁下的IP已被系统记录!');history.back(-1);</script>")
response.end
else
rs("LoginTime")=now()
rs("LoginIP")=ip
rs.update
set rs3=server.createobject("adodb.recordset")
rs3.Open "Select * From rizhi Where 1=0",conn,1,3
rs3.AddNew
rs3("UserName")=lUserName
rs3("addtime")=Now()
rs3("ip")=ip
rs3("itype")=2
rs3.Update
rs3.Close
session("ID")=rs("ID")
session("UserName")=rs("UserName")
session("Name")=rs("Name")
session("UserPass")=rs("UserPass")
session("Ction")=rs("Ction")
session("Ction2")=rs("Ction2")
session("Ction3")=rs("Ction3")
response.Redirect"./index"
end if
rs.close
set rs=nothing
%>