?? login.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<!--#include file="md5.asp"-->
<!--#include file="Connections/conn.asp" -->
<!--#include file="chksql.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>客戶(hù)資料收集系統(tǒng)</title>
<script language="JavaScript">
<!--
if (this.location.href == top.location.href){
top.location.href = "";
}
function checkInput()
{
var strItem1 = document.all.item1.value;
var strItem2 = document.all.item2.value;
if (strItem1 == ""){
document.all.errMsg.innerHTML = "<font color=\"#FF0000\">請(qǐng)輸入賬號(hào)。</font>"
document.all.item1.focus();
return false;
}
if (strItem2 == ""){
document.all.errMsg.innerHTML = "<font color=\"#FF0000\">請(qǐng)輸入密碼。</font>"
document.all.item2.focus();
return false;
}
}
function checkChr(chr)
{
var str0 = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var intLen = chr.length;
for (var i=0;i<intLen;i++){
}
}
-->
</script>
<link href="myStyle.css" rel="stylesheet" type="text/css">
</head>
<body style="background-color: menu;" >
<%
If Session("CRM_account") <> "" And Session("CRM_name") <> "" And Session("CRM_level") > 0 Then Response.Redirect("listAll.asp")
Dim action
action = Trim(Request("action"))
Select Case action
Case "login"
Call login()
Case Else
Call loginForm()
End Select
Sub login()
Dim account,password,psword
account = Trim(Request("item1"))
password = md5(replace(Trim(Request("item2")),"'",""))
psword=trim(request("psword"))
if psword= "" then
response.Redirect("login.asp?errmsg=5")
response.End()
end if
if psword<>session("yanzheng") then
response.Redirect("login.asp?errmsg=4")
response.End()
end if
If account = "" Or password = "" Then
Response.Redirect("login.asp?errMsg=2")
Response.End()
End If
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_user Where uAccount = '" & account & "' and uPassword='"&password&"' ",conn,3,1
If rs.RecordCount <> 1 Then
Response.Redirect("login.asp?errMsg=1")
Response.End()
End If
If password <> rs("uPassword") Then
Response.Redirect("login.asp?errMsg=1")
Response.End()
End If
If rs("uBlock") = True Then
Response.Redirect("login.asp?errMsg=3")
Response.End()
End If
Session("CRM_account") = account
Session("CRM_name") = rs("uName")
Session("CRM_level") = rs("uLevel")
Session("CRM_group") = rs("uGroup")
rs.Close
Set rs = Nothing
Response.Redirect("listAll.asp")
End Sub
Sub loginForm()
Dim errMsg
errMsg = CInt(ABS(Request("errMsg")))
Select Case errMsg
Case 2
errMsg = "<font color=""#FF0000"">請(qǐng)輸入賬號(hào)和密碼。</font>"
Case 1
errMsg = "<font color=""#FF0000"">賬號(hào)密碼錯(cuò)誤。</font>"
Case 3
errMsg = "<font color=""#FF0000"">賬號(hào)被凍結(jié)。</font>"
Case 4
errMsg = "<font color=""#FF0000"">驗(yàn)證碼錯(cuò)誤。</font>"
Case 5
errMsg = "<font color=""#FF0000"">驗(yàn)證碼不能為空。</font>"
Case Else
errMsg = ""
End Select
%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="364" border="0" cellspacing="0" cellpadding="2" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #888888; border-top: 1px solid #FFFFFF; border-bottom: 1px solid #888888;">
<form name="loginForm" action="login.asp?action=login" method="post" onSubmit="return checkInput();">
<tr>
<td><img src="images/crm_8.gif" width="362" height="82"></td>
</tr>
<tr>
<td height="24" id="errMsg"><% = errMsg %></td>
</tr>
<tr>
<td height="24" align="center">賬 號(hào):
<input name="item1" type="text" id="item1" size="12" maxlength="16" style="ime-mode: disabled;" onFocus="this.select(); this.value='';"></td>
</tr>
<tr>
<td height="24" align="center">密 碼:
<input name="item2" type="password" id="item2" size="12" maxlength="16" style="ime-mode: disabled;" onFocus="this.select(); this.value='';"></td>
</tr>
<tr>
<td height="24" align="center"> 驗(yàn)證碼 :
<input name="psword" type="text" id="psword" size="12" maxlength="16" style="ime-mode: disabled;" onFocus="this.select(); this.value='';">
<% dim num
randomize
num=round(rnd()*8999+1000)
session("yanzheng")=trim(num)
response.Write(num)
%></td>
</tr>
<tr>
<td height="24" align="center"> </td>
</tr>
<tr>
<td height="24" align="center">
<input type="submit" name="Submit" value="提交">
<input name="Reset" type="reset" id="Reset" value="重置"></td>
</tr>
<tr>
<td height="24" align="center"> </td>
</tr>
</form>
</table></td>
</tr>
</table>
<%
End Sub
%>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -