asp完整登陸代碼
<%
option explicit
強制浏覽器重新訪問服務器下載頁面
Response
Response
Response
Response
Response
主要是使隨機出現的圖片數字隨機
%>
<!
<!DOCTYPE HTML PUBLIC "
<HTML>
<HEAD>
<TITLE><%=rs_config("c_incname")%>
<meta http
<LINK href="inc/login
<base target="main">
<style type="text/css">
<!
</style>
<SCRIPT language=JavaScript>
<!
function frmSubmit() {
if (theForm
alert("請輸入用戶名");
theForm
return false;
}
if (theForm
alert("請輸入密碼");
theForm
return false;
}
if (theForm
alert("請輸入校驗碼");
theForm
return false;
}
return true;
}
//
</SCRIPT>
<link rel="icon" href="/favicon
<link rel="shortcut icon" href="/favicon
<META http
<LINK
href="images/WEI
<META content="Microsoft FrontPage
</HEAD>
<BODY bgColor=#ffffff>
<BR>
<br>
<br>
<br>
<br>
<BR>
<TABLE align="center" cellSpacing=
<TBODY>
<TR>
<TD width="
<TABLE align="center" cellSpacing=
<TBODY>
<TR>
<TD vAlign=top width="
<FORM action=logincheck
<table width="
<tr>
<td colspan="
</tr>
<tr>
<td width="
<tr>
<td height="
</tr>
<tr>
<td width="
<td width="
<td width="
<td width="
<td width="
<td width="
src="inc/Code
</tr>
<tr>
<td><input name=name id="name" size=
<td><input name=pass type=password id="pass" size=
<td> </td>
<td><INPUT name="safecode" type=text id="safecode" size=
</tr>
</table></td>
<td>
<input type="image" name="Submit" src="Images/Admin_Login
</tr>
</table>
</FORM>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
下面是asp處理文件
<%@LANGUAGE="VBSCRIPT" CODEPAGE="
<meta http
<!
<!
<%
function ChkPost()
dim server_v
chkpost=false
server_v
server_v
if mid(server_v
chkpost=false
else
chkpost=true
End if
End function
session
if ChkPost=false then
response
Response
End if
dim aname
FoundErr=False
aname=replace(trim(request("name"))
apass=replace(trim(request("pass"))
safecode=replace(trim(Request("safecode"))
if len(aname)>
FoundErr=True
ErrMsg=ErrMsg&"用戶名不對!nn"
End if
if len(apass)>
FoundErr=True
ErrMsg=ErrMsg&"用戶密碼不對!nn"
End if
if Safecode="" then
FoundErr=True
ErrMsg=ErrMsg & "驗證碼不能為空!nn"
end if
if Session("Admin_GetCode")="" then
FoundErr=True
ErrMsg=ErrMsg & "你登錄時間過長
end if
if Safecode<>CStr(Session("Admin_GetCode")) then
FoundErr=True
ErrMsg=ErrMsg & "您輸入的確認碼和系統產生的不一致
end if
if FoundErr=True then
Call LoginError(ErrMsg)
Conn
Set Conn=Nothing
else
apass=md
dim sql
sql="select a_name
set rs=server
rs
if rs
ErrMsg="用戶名或是密碼錯誤!"
Call LoginError(ErrMsg)
rs
set rs=Nothing
conn
set conn=Nothing
response
elseif Not(rs
session("aname")=rs("a_name")
session("admin_flag")="into"
session("admin_sys")=rs("a_flag")
response
rs
set rs=Nothing
conn
set conn=Nothing
response
End if
end if
Sub LoginError(EMsg)
response
response
response
response
Response
End Sub
%>
From:http://tw.wingwit.com/Article/program/net/201311/14357.html