📄 login.asp
字号:
<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../Include/Class_Pass.asp" -->
<%
'//定义变量
Dim Rs,SQL,Tmp(3)
Dim UserName,UserType,Password,LastIp
Dim UserStr,UserUrl
VT_SysNum = 1
UserName = Replace_Text(Request.Form("username"))
Password = Replace_Text(Request.Form("password"))
UserType = Replace_Text(Request.Form("UserType"))
Password = Md5(Password)
LastIp = Request.Servervariables("Remote_Addr")
Select Case UserType
Case "person"
Call PersonLogin()
Case "company"
Call CompanyLogin()
Case "school"
Call SchoolLogin()
Case "educate"
Call EducateLogin()
End Select
'//个人会员登陆
Sub PersonLogin()
UserStr = "个人"
UserUrl = "Person"
SQL = "Select Username,Perid,Password From [pH_Person_Base] Where UserName='"&Username&"' And Password='"&Password&"'"
Set Rs = Conn.Execute(SQL)
If Not Rs.Eof Then
If Rs("Password") = Password Then
Conn.Execute("Update [pH_Person_Base] Set LastDate='"&Now()&"',LastIp='"&LastIp&"',LoginCount=LoginCount+1 Where UserName='"&Username&"'")
Tmp(0) = Rs("UserName")
Tmp(1) = Rs("Password")
Tmp(2) = Rs("Perid")
'//清除其他会员的登陆标记
Session("Company") = ""
Session("School") = ""
'//清除结束
Session("Person") = Tmp
Session("Server") = Request.ServerVariables("Server_Name")
'//视频商务
Session(VT_SysNum & "_" & "WebVT_MemberName") = Rs("Username")
Session(VT_SysNum & "_" & "WebVT_IsNameOK") = 1
'//---------------论坛会员登陆-------------------
SQL = "Select User_name,Admin_Flag From [User] Where User_Name='"&Username&"' And User_Pass='"&Replace_text(request.form("password"))&"'"
Set Rs1 = Conn.Execute(SQL)
If Not Rs1.eof Then
Conn.Execute("Update [User] Set Login_Last_Date='"&Now()&"',Login_Last_ip='"&LastIp&"',Login_Count=Login_Count+1 Where User_Name='"&Username&"' And User_Pass='"&Replace_text(request.form("password"))&"'")
Session("bbsusername") = Rs1("User_name")
Session("bbsuserflag") = Rs1("Admin_Flag")
End if
Rs1.Close
Set Rs1 = Nothing
'//---------------论坛会员登陆结束-------------------
Response.write "<meta http-equiv=refresh content=""3;URL=../Person/User_Center.asp"">"
Call Login()
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Person/index.asp"">"
Call LoginError()
End if
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Person/index.asp"">"
Call LoginError()
End if
End Sub
'//企业会员登陆
Sub CompanyLogin()
UserStr = "企业"
UserUrl = "Company"
SQL = "Select Username,Comid,Password,Nc_Vip_Flag,Nc_Vip_Date,Nc_Vip_EndDate From [pH_Company_Base] Where UserName='"&Username&"' And Password='"&Password&"'"
Set Rs = Conn.Execute(SQL)
If Not Rs.Eof Then
If Rs("Password") = Password Then
Conn.Execute("Update [pH_Company_Base] Set LastDate='"&Now()&"',LastIp='"&LastIp&"',LoginCount=LoginCount+1 Where UserName='"&Username&"'")
Tmp(0) = Rs("UserName")
Tmp(1) = Rs("Password")
Tmp(2) = Rs("Comid")
'//清除其他会员的登陆标记
Session("Person") = ""
Session("School") = ""
'//清除结束
Session("Company") = Tmp
Session("Server") = Request.ServerVariables("Server_Name")
'//视频商务
Session(VT_SysNum & "_" & "WebVT_MemberName") = Rs("Username")
Session(VT_SysNum & "_" & "WebVT_IsNameOK") = 1
'//判断是否是VIP会员
If Rs("Nc_Vip_Flag") = True Then
If DateDiff("d",Rs("Nc_Vip_Date"),Date()) >= 0 And DateDiff("d",Rs("Nc_Vip_EndDate"),Date()) <= 0 Then
Session("Nc_Vip") = 1 '//VIP会员
Else
Session("Nc_Vip") = 2 '//过期的VIP会员
End if
Else
Session("Nc_Vip") = 0 '//免费会员
End if
Response.write "<meta http-equiv=refresh content=""3;URL=../Company/User_Center.asp"">"
Call Login()
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Company/index.asp"">"
Call LoginError()
End if
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Company/index.asp"">"
Call LoginError()
End if
End Sub
'//院校会员登陆
Sub SchoolLogin()
UserStr = "院校"
UserUrl = "School"
SQL = "Select Username,Schid,Password From [pH_School_Base] Where UserName='"&Username&"' And Password='"&Password&"'"
Set Rs = Conn.Execute(SQL)
If Not Rs.Eof Then
If Rs("Password") = Password Then
Conn.Execute("Update [pH_School_Base] Set LastDate='"&Now()&"',LastIp='"&LastIp&"',LoginCount=LoginCount+1 Where UserName='"&Username&"'")
Tmp(0) = Rs("UserName")
Tmp(1) = Rs("Password")
Tmp(2) = Rs("Schid")
'//清除其他会员的登陆标记
Session("Person") = ""
Session("Company") = ""
'//清除结束
Session("School") = Tmp
Session("Server") = Request.ServerVariables("Server_Name")
Response.write "<meta http-equiv=refresh content=""3;URL=../School/User_Center.asp"">"
Call Login()
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../School/index.asp"">"
Call LoginError()
End if
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../School/index.asp"">"
Call LoginError()
End if
End Sub
'//培训机构会员登陆
Sub EducateLogin()
UserStr = "培训机构"
UserUrl = "Educate"
SQL = "Select Username,Schid,Password From [pH_Educate_Base] Where UserName='"&Username&"' And Password='"&Password&"'"
Set Rs = Conn.Execute(SQL)
If Not Rs.Eof Then
If Rs("Password") = Password Then
Conn.Execute("Update [pH_Educate_Base] Set LastDate='"&Now()&"',LastIp='"&LastIp&"',LoginCount=LoginCount+1 Where UserName='"&Username&"'")
Tmp(0) = Rs("UserName")
Tmp(1) = Rs("Password")
Tmp(2) = Rs("Schid")
'//清除其他会员的登陆标记
Session("Person") = ""
Session("Company") = ""
Session("School") = ""
Session("Corps") = ""
Session("Intro") = ""
Session("Educate") = ""
'//清除结束
Session("Educate") = Tmp
Session("Server") = Request.ServerVariables("Server_Name")
Response.write "<meta http-equiv=refresh content=""3;URL=../Educate/User_Center.asp"">"
Call Login()
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Educate/index.asp"">"
Call LoginError()
End if
Else
Response.write "<meta http-equiv=refresh content=""3;URL=../Educate/index.asp"">"
Call LoginError()
End if
End Sub
CloseDB
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Css.css" type=text/css rel=stylesheet>
<title><%= Cls_WebName %> -- 会员登录</title>
</head>
<body>
<% Sub Login() %>
<LINK href="../Css/Css.css" type=text/css rel=stylesheet>
<p> </p>
<table width="80%" border="0" align="center" cellspacing="1" bgcolor="#eeeeee">
<tr>
<td height="100" bgcolor="f5f5f5"><table width="90%" border="0" align="center" cellspacing="0" class="text01">
<tr>
<td height="30" align="center">登录成功 <%= Cls_WebName %>欢迎您的到来</td>
</tr>
<tr>
<td height="3" bgcolor="ff6600"></td>
</tr>
<tr>
<td height="30" align="center"><font color=#999999>如果不能跳转,请点击这里进入<a href="../<%= UserUrl %>/User_Center.asp"><font color=#999999><%= UserStr %>管理平台</font></a></font></td>
</tr>
</table></td>
</tr>
</table>
<%
End Sub
Sub LoginError()
%>
<LINK href="../Css/Css.css" type=text/css rel=stylesheet>
<p> </p>
<table width="80%" border="0" align="center" cellspacing="1" bgcolor="#eeeeee">
<tr>
<td height="100" bgcolor="f5f5f5"><table width="90%" border="0" align="center" cellspacing="0" class="text01">
<tr>
<td height="30" align="center">
登录失败 请检查您的用户名或密码是否填写正确
</td>
</tr>
<tr>
<td height="3" bgcolor="cccccc"></td>
</tr>
<tr>
<td height="30" align="center"><font color=#999999>如果不能跳转,<a href="../<%= UserUrl %>/Index.asp"><font color=#999999>请点击这里</font></a></font></td>
</tr>
</table></td>
</tr>
</table>
<%
End Sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -