gusucode.com > ASP+ACCESS在线人才招聘网(源代码+论文) > ASP+ACCESS在线人才招聘网(源代码+论文)\source_\login.asp

    <!--#include file="inc/conn.asp"-->
<!--#include file="resultred.asp"-->
<%
login=Replace(trim(Request("login")),"'","")
passwd=trim(Request("passwd"))
login_type=Request("login_type")
if login="" or passwd="" then
 resultred"帐号名或者密码为空,登陆失败"
end if
Set Rs=Server.CreateObject("Adodb.RecordSet")
if login_type=0 then
sql="select per_id,password,acount from job_person where username='"&login&"'"
Rs.Open sql,conn,1,1
if Rs.eof then
 resultred"不存在该帐号名,如果没有还没有注册,请先注册"
else
 if Rs("password")<>passwd then
  resultred"你输入的帐号名和密码不相符,请重新登陆"
 else
  session("username")=login
  session("acount")=Rs("acount")
  session("per_id")=Rs("per_id")
  Response.Redirect"person_myself.asp"
 end if
end if
else if login_type=1 then
 sql="select ep_id,passwd,ep_acount from enterprise where login='"&login&"'"
  Rs.Open sql,conn,1,1
  if not rs.eof then
    if rs("passwd")=passwd then
	  session("login")=login
	  session("account")=Rs("ep_acount")
	  session("ep_id")=Rs("ep_id")
	  Response.Redirect "company_myself.asp"
	 else
	  resultred"密码错误,请重新登陆"
	end if
  else
     resultred"该用户名不存在,请重新登陆"
  end if
 end if
 end if
  Rs.Close
  Set Rs=nothing
  Set conn=nothing
%>