最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp简单的用户登录
时间:2022-07-02 22:44:36 编辑:袖梨 来源:一聚教程网
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_datadb2.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
%>
相关文章
- 《夜族崛起》铁匠西里尔位置一览 05-17
- 《寓言之地》1.02更新内容一览 05-17
- 《辐射4》steam好评率介绍 05-17
- 《夜族崛起》技能强化珠宝掉落说明 05-17
- 《辐射4》主机控制台介绍 05-17
- 《星露谷物语》海草和绿藻获取方法 05-17