知识大全 asp完整登陆代码
Posted 知
篇首语:既然认准一条路,就别去打听要走多久。本文由小常识网(cha138.com)小编为大家整理,主要介绍了知识大全 asp完整登陆代码相关的知识,希望对你有一定的参考价值。
asp完整登陆代码 <% option explicit 强制浏览器重新访问服务器下载页面 而不是从缓存读取页面 Response Buffer = True Response Expires = Response ExpiresAbsolute = Now() Response Expires = Response CacheControl = "no cache" 主要是使随机出现的图片数字随机 %> <! #include file="inc/config asp" > <!DOCTYPE HTML PUBLIC " //W C//DTD HTML Transitional//EN"> <HTML> <HEAD> <TITLE><%=rs_config("c_incname")%> 管理员登录</TITLE> <meta equiv="Content Type" content="text/; charset=gb "> <LINK href="inc/login css" rel=stylesheet type=text/css> <base target="main"> <style type=text/css> <! style font size: pt > </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 equiv=Content Type content="text/; charset=gb "> <LINK href="images/WEI css" type=text/css rel=stylesheet> <META content="Microsoft FrontPage " name=GENERATOR> </HEAD> <BODY bgColor=#ffffff> <BR> <br> <br> <br> <br> <BR> <TABLE align=center cellSpacing= cellPadding= width= border= bordercolor="# "> <TBODY> <TR> <TD width= > <TABLE align=center cellSpacing= cellPadding= width= border= bordercolor="# "> <TBODY> <TR> <TD vAlign=top width= height= > <FORM action=logincheck asp method=POST target="_top"> <table width= border= align=center cellpadding=" " cellspacing=" "> <tr> <td colspan=" "><img src=images/Admin_Login gif width= height= ></td> </tr> <tr> <td width= valign="top" background="Images/Admin_Login gif"><table width= border= cellspacing=" " cellpadding=" "> <tr> <td height= colspan=" "> </td> </tr> <tr> <td width= rowspan=" "> </td> <td width= ><font color="# BC ">用户名称 </font></td> <td width= rowspan=" "> </td> <td width= ><font color="# BC ">用户密码 </font></td> <td width= > </td> <td width= ><font color="# BC ">验证码 <b><font color=#ff ><IMG src=inc/Code asp width= height= align=absmiddle></font></b></font></td> </tr> <tr> <td><input name=name id="name" size= ></td> <td><input name=pass type=password id="pass" size= ></td> <td> </td> <td><INPUT name=safecode type=text id="safecode" size= ></td> </tr> </table></td> <td> <input type=image name=Submit src=Images/Admin_Login gif ></td> </tr> </table> </FORM> </TD> </TR> </TBODY> </TABLE> </TD> </TR> </TBODY> </TABLE> </BODY> </HTML>
下面是asp处理文件 <%@LANGUAGE="VBSCRIPT" CODEPAGE=" "%> <meta equiv="Content Type" content="text/; charset=gb ">
<! #include file="conn asp" > <! #include file="md asp" >
<% function CPost() dim server_v server_v cpost=false server_v =Cstr(Request ServerVariables("HTTP_REFERER")) server_v =Cstr(Request ServerVariables("SERVER_NAME")) if mid(server_v len(server_v ))<>server_v then cpost=false else cpost=true End if End function session Timeout= if CPost=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)> or len(aname)< then FoundErr=True ErrMsg=ErrMsg&"用户名不对!nn" End if
if len(apass)> or len(apass)< 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=md (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 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( ) response write "alert( "&EMsg&" );" & Chr( ) response write "window document location ;"&Chr( ) response write "</script>" & Chr( ) Response End End Sub
cha138/Article/program/net/201311/14357相关参考
cha138/Article/program/net/201311/14351
DimobjXMLHTTPxmlplace Setxml=ServerCreateObject("MicrosoftXMLHT
<%@LANGUAGE="VBSCRIPT"CODEPAGE=""%><%session("aname")=""session("admin_flag")=""sessionAb
的登陆页面中之前按回车老是不是自动登陆后来发现只需要修改formDefaultButton属性就可以了设置代码如下 [csharp] <span>thisformDefaultBu
如何编写远程登陆MOSS的代码 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! <!DOCT
PrivateSubButton_Click(ByValsenderAsSystemObjectByValeAsSystemEventArgs)HandlesButtonClick IfText
ASP登陆验证页应做的安全问题 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! 应对ASP溢出漏洞
ASP.NET2.0防止同一用户同时登陆 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! 要防止同
环境Tomcat+JSE+PostgreSQL 我将分几个步骤完成对一个新闻发布系统的构建来理解JSP的一些基本使用方法! 首先我将先介绍这个新闻发布系统的基本结构 indexjsp管理员登
跑跑卡丁车到登陆页面就一闪没了自己关了错误代码114.相信大部分朋友都不陌生了这个代码比其他代码都要麻烦的多因为玩家并不知道自己到底是哪个软件出了问题和跑跑产生冲突所以我去查了很多资料收集了解决114