<!--#include file="Include/Conn.asp" -->
<!--#include file="Include/char.asp" -->
<!--#include file="Include/md5.asp"-->
<%
	dim mSql,rs
	dim mUserName,mPassword
	dim mIntegral
	mIntegral = 0 '登陆一次积分加10
	mUserName = checkStr(Trim(Request.Form("txtUserName")))
	mPassword = checkStr(Trim(Request.Form("txtPassword")))
	'查找用户
	mSql = "Select * from T_Member where F_UserName='" & mUserName & "'"
    Set rs = conn.Execute(mSql)

	if rs.bof and rs.eof then
	   '无此用户
	   rs.Close
	   CloseDatabase()
	   call Msgbox("对不起，不存在该用户名，或该用户名已被锁定.需管理员审核！",1)
       Response.end			
	else
   	   if md5(mPassword)<>rs("F_PassWord") then
          '密码错误
		  'rs.Close
	      
		  Call Msgbox("对不起，您的密码不正确！请输入正确的密码！",1)
		 
	   else
		  
          Response.Cookies("aspxnet")("CurUserID") = rs("F_ID")

          Response.Cookies("aspxnet")("CurUserName") = rs("F_UserName")
          Session.Contents("OnlinUserName") = checkStr(rs("F_UserName"))
		  '个人主页
		  session("co")=rs("F_co")
          session("goname")=rs("F_UserName")
          session("pic")=rs("T_pic")
          session("goid")=rs("F_ID")
          session("coname")=trim(rs("F_coname"))
		  session("name")=rs("F_realName")

	      '返回	   
		  m_Return = Request.QueryString("return")
          IF m_Return = "" then
		    Response.Redirect "index.asp"
		  Else
		    Response.Redirect m_Return
		  End if
		    Response.end
	   End if
	End if
    rs.close
	CloseDatabase()
%>