最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp简单的用户登录
时间:2008-06-20 编辑:简简单单 来源:一聚教程网
asp简单的用户登录
<%
Dim uid,pwd
uid =html_encode(Request.Form("Uid") )
pwd =html_encode(Request.Form("pwd") )
If uid ="admin_videa" and pwd="videa888" Then
Session("Admin")=uid
Response.Redirect("../Input.asp")
Else
Response.Write("")
Response.End()
End if
%>
下面是数据库连接函数
<%
Dim Rs,Conn
Sub Db_connect()
Dpath ="\D_data\db2.mdb"
Set Conn=Server.CreateObject("Adodb.connection")
Set Rs =Server.CreateObject("Adodb.Recordset")
Conn.connectionstring="Provider=Microsoft.Jet.oledb.4.0;Data source="&Server.MapPath(Dpath)
Conn.open
End sub
sub closedb()
if isobject(Rs) then
if not(Rs is nothing) then
Rs.close
set Rs=nothing
end if
end if
if isobject(Conn) then
if not(Conn is nothing) then
Conn.close
set Conn=nothing
end if
end if
end sub
'********************************************************* 过滤不安全
function html_encode(html)
dim temp
temp=replace(html,"<","<")
temp=replace(temp,">",">")
temp=replace(temp,"'","单引号")
temp=replace(temp,chr(13),"
")
html_encode=replace(temp,chr(32)," ")
end function
function encode_html(html)
dim temp
temp=replace(html,"<","<")
temp=replace(temp,">",">")
temp=replace(temp,"单引号","'")
temp=replace(temp,chr(13),"
")
encode_html=replace(temp,chr(32)," ")
end function
这里是退出登录函数
function Login()
If Session("Admin")="" then
Response.Write("")
Response.End()
End if
End function
%>
-
上一个: asp调用图片的大小
-
下一个: aspjpeg给图片加水印 代码
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14