2017-04-12
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍。在有些时候我们是需要用到ASP的登录界面代码的,有的人不知道在哪里可以找到,我们今天就一起来看看吧。
asp完整登陆代码
<%
option explicit
强制浏览器重新访问服务器下载页面,而不是从缓存读取页面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
主要是使随机出现的图片数字随机
%>
<!--#include file="inc/config.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE><%=rs_config("c_incname")%>-管理员登录</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="inc/login.css" rel=stylesheet type=text/css>
<base target="main">
<style type="text/css">
<!--
.style2 {font-size: 12pt}
-->
</style>
<SCRIPT language=JavaScript>
<!--
function frmSubmit() {
if (theForm.name.value == "") {
alert("请输入用户名");
theForm.name.focus();
return false;
}
if (theForm.pass.value == "") {
alert("请输入密码");
theForm.pass.focus();
return false;
}
if (theForm.safecode.value == "") {
alert("请输入校验码");
theForm.safecode.focus();
return false;
}
return true;
}
//-->
</SCRIPT>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK
href="images/WEI.css" type=text/css rel=stylesheet>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<BR>
<br>
<br>
<br>
<br>
<BR>
<TABLE align="center" cellSpacing=0 cellPadding=0 width=555 border=0 style="border-collapse: collapse" bordercolor="#111111">
<TBODY>
<TR>
<TD width="588">
<TABLE align="center" cellSpacing=0 cellPadding=0 width=558 border=0 style="border-collapse: collapse" bordercolor="#111111">
<TBODY>
<TR>
<TD vAlign=top width="360" height="104">
<FORM action=logincheck.asp method=POST target="_top">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="images/Admin_Login1.gif" width="600" height="126"></td>
</tr>
<tr>
<td width="508" valign="top" background="Images/Admin_Login2.gif"><table width="508" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="37" colspan="6"> </td>
</tr>
<tr>
<td width="75" rowspan="2"> </td>
<td width="126"><font color="#043BC9">用户名称:</font></td>
<td width="39" rowspan="2"> </td>
<td width="131"><font color="#043BC9">用户密码:</font></td>
<td width="34"> </td>
<td width="103"><font color="#043BC9">验证码:<b><font color=#ff0000><IMG
src="inc/Code.asp" width="40" height="10" align="absmiddle"></font></b></font></td>
</tr>
<tr>
<td><input name=name id="name" size=15></td>
<td><input name=pass type=password id="pass" size=12></td>
<td> </td>
<td><INPUT name="safecode" type=text id="safecode" size=12></td>
</tr>
</table></td>
<td>
<input type="image" name="Submit" src="Images/Admin_Login3.gif" style="width:92px; HEIGHT: 126px;"></td>
</tr>
</table>
</FORM>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
下面是asp处理文件
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
function ChkPost()
dim server_v1,server_v2
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
End if
End function
session.Timeout=20
if ChkPost=false then
'emsg="请不要从其它站点提交表"
response.Redirect("login.asp?emsg=请不要从其它站点提交表")
Response.End()
End if
dim aname,apass,FoundErr,ErrMsg
FoundErr=False
aname=replace(trim(request("name")),"'","")
apass=replace(trim(request("pass")),"'","")
safecode=replace(trim(Request("safecode")),"'","")
if len(aname)>20 or len(aname)<3 then
FoundErr=True
ErrMsg=ErrMsg&"用户名不对!nn"
End if
if len(apass)>20 or len(apass)<6 then
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 & "你登录时间过长,请重新返回登录页面进行登录。nn"
end if
if Safecode<>CStr(Session("Admin_GetCode")) then
FoundErr=True
ErrMsg=ErrMsg & "您输入的确认码和系统产生的不一致,请重新输入。nn"
end if
if FoundErr=True then
Call LoginError(ErrMsg)
Conn.close
Set Conn=Nothing
else
apass=md5(apass)
dim sql,rs
sql="select a_name,a_pass,a_flag from admin where a_name='"&aname&"' and a_pass='"&apass&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.BOF and rs.EOF then
ErrMsg="用户名或是密码错误!"
Call LoginError(ErrMsg)
rs.close
set rs=Nothing
conn.close
set conn=Nothing
response.End
elseif Not(rs.BOF or rs.EOF) then
session("aname")=rs("a_name")
session("admin_flag")="into"
session("admin_sys")=rs("a_flag")
response.Redirect("useradmin.asp")
rs.close
set rs=Nothing
conn.close
set conn=Nothing
response.End
End if
end if
Sub LoginError(EMsg)
response.write "<script language='javascript'>" & chr(13)
response.write "alert('"&EMsg&"');" & Chr(13)
response.write "window.document.location.href='login.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
End Sub
%>
1
CI框架连接数据库配置操作以及多数据库操作
09-05
2
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
05-17
3
C语言关键字及其解释介绍 C语言32个关键字详解
04-05
4
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
04-26
5
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
09-05
6
PHP中的(++i)前缀自增 和 (i++)后缀自增
09-05
7
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
04-12
8
常用dos命令及语法
09-27
PHP中include和require区别之我见
2014-09-05
将视频设置为Android手机开机动画的教程
2014-12-11
php递归返回值的问题
2014-09-05
如何安装PHPstorm并配置方法教程 phpstorm安装后要进行哪些配置
2017-05-03
PHP 教程之如何使用BLOB存取图片信息实例
2014-09-05
java中的info是什么意思
2022-03-24
单片机编程好学吗?单片机初学者怎样看懂代码
2022-03-21
学ug编程如何快速入门?
2022-03-17
PHP数组函数array
2014-09-05
IcePHP框架中的快速后台中的通用CRUD功能框架
2014-09-05
弓箭大师你就是王者游戏下载v2.0.1 安卓最新版
其它手游 164.4M
下载弓箭大师你就是王者官方版下载v2.0.1 安卓版
其它手游 164.4M
下载3d狙击王者手机游戏下载v1.5 安卓版
射击枪战 63.0M
下载足球冲鸭手机版下载v1.0.16.404.401.0116 安卓版
其它手游 81.0M
下载有种来找我手游下载v1.4.8 安卓版
动作闯关 104.7M
下载忍者跳跳跳官方版下载v1.0.2 安卓版
动作闯关 46.8M
下载百战斗斗堂拇指游戏下载v5.8 安卓版
射击枪战 294.3M
下载梦幻斗斗堂手游下载v5.8 安卓版
其它手游 294.3M
下载百战斗斗堂4399版下载v5.8 安卓版
下载
百战斗斗堂九游手游下载v5.8 安卓版
下载
百战斗斗堂手游下载v5.8 安卓正版
下载
弓箭传说bt版下载v2.14.1 安卓版
下载
美味星球永恒手机版下载v1.8.7.0 安卓版
下载
火柴人战争遗产争夺游戏下载v2022.1.9安卓版
下载
史小坑的花前月下游戏下载v1.7.8 安卓版
下载
谁也别想跑小游戏下载v21.01.05 安卓版
下载