<!--#include file="../conn/conn.asp" -->
<!--#include file="../inc/md5.asp"-->
<%SQLin
if trim(request("link"))<>"" then
num=len(request.QueryString)
	if num>=5 then
		link=right(request.QueryString,(num-5))
	end if	
end if
trueIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If trueIP="" Then trueIP=Request.ServerVariables("REMOTE_ADDR")
pmember_login=trim(request("login"))
Function isletternumber(strng)
 isletternumber = false
 Dim regEx, Match ' Create variables.
 Set regEx = New RegExp   ' Create a regular expression object (stupid, huh?)
 regEx.Pattern = "^[A-Za-z0-9]{4,20}$" ' Sets pattern.
 regEx.IgnoreCase = True   ' Set case insensitivity.
 Set Match = regEx.Execute(strng)   ' Execute search.
 if match.count then isletternumber= true
End Function
'if not isletternumber(pmember_login) then
' response.write ("<script language=JavaScript>{alert('用户名：要求为4-20个字母或数字！请重新输入。');location.href = 'javascript:history.back()';}<//script>")
' response.End 
'end if
pmember_pwd=MD5(trim(request("pwd")),32)
set rs=server.createobject("ADODB.Recordset")
sql="select * from job_Member where Member_login='"&pmember_login&"'"
rs.open sql,conn,1,3
if rs.eof then
 rs.close
 set rs=nothing
 CloseConn
 Response.Write ("<script language=JavaScript>{alert('用户名或密码错误，请重新登录！');location.href = 'javascript:history.back()';}</script>")
 Response.End 
else
	member_flag=rs("Member_flag")
	If member_flag<>1 Then
		 response.write("<script>alert(""您的帐号还没有通过审核，无法登录！"");history.back();</script>")
		 response.End()
	End If
 if cstr(pmember_pwd)<>cstr(rs("Member_pwd")) then
  rs.close
  set rs=nothing
  CloseConn
  Response.Write ("<script language=JavaScript>{alert('用户名或密码错误，请重新登录！');location.href = 'javascript:history.go(-1)';}</script>")
  Response.End 
 else
	rs("Member_LoginIP")=trueIP
	If IsNumeric(rs("Member_LoginNum")) Then
		rs("Member_LoginNum")=rs("Member_LoginNum")+1
	Else
		rs("Member_LoginNum")=1
	End If
	rs("Member_logindate")=now()
	rs.Update
	Response.Cookies(FRHRCMS)("LoginIP")=rs("Member_LoginIP")
	Response.Cookies(FRHRCMS)("LoginTimes")=rs("Member_logindate")
	Response.Cookies(FRHRCMS)("user_type")="pmember"
	Response.Cookies(FRHRCMS)("user_login")=pmember_login
	Response.Cookies(FRHRCMS)("user_pass")=pmember_pwd
	if rs("Member_name")<>"" then Response.Cookies(FRHRCMS)("user_name")=rs("Member_name")
  rs.close
  set rs=nothing
  CloseConn
  if link<>"" and not isnull(link) then
   response.redirect link
   response.end 
  else
   response.redirect "person_index.asp"
   response.end
  end if
 end if
end if
%>