⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lj.asp

📁 主要实现了asp+flash用户登录的功能
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'获取Flash中传过来的变量

'设置一个连接对象
set conn=Server.Createobject("adodb.connection")
'数据库的相对路径
'数据库的驱动
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("YHXX.mdb")
'打开连接
'新建记录集对象
set rs=server.createobject("adodb.recordset") 
 cc_asp=Request("cc_fl")
 %>
<% 
Select Case cc_asp
case "登录"
dd
case "注册"
zc
case "寻找"
fd
case "比较"
bj
end select
'if cc_asp="登录" then
'dd
'else if cc_asp="注册" then zc
'else  cc_asp="寻找" then fd
'end if
%>
<%
function dd()
 username=trim(Request("username_fla"))
 password=trim(Request("passwd_fla"))
 'SQL查询语句,用来查询数据库中是否有数据;
sql="select * from yhxx where username='"&username&"'" 
'Response.Write("&username="&username + "&")
'打开查询语句
rs.open sql,conn,1,1
if not rs.eof then 
if password=rs("passwd") then 
Response.write("&TS_asp=正确登录" ) 
else 
response.write ("&TS_asp=密码错") 
end if 
end if 
if rs.eof then 
response.write ("&TS_asp=用户名错") 
end if 
end function
%>
<%
function zc()
username=trim(Request("ZCZH_fl"))
password=trim(Request("ZCMM_fl"))
xb=trim(Request("XB_fl"))
gzdw=trim(Request("ZCDW_fl"))
bhwt=trim(Request("ZZWT_fl"))
bhda=trim(Request("ZCDA_fl"))
sql="select * from yhxx where username='"&username&"'" 
addsql="insert into yhxx (username,passwd,xb,gzdw,bhwt,bhda) values ( '" & username & "', '" &password&"','"&xb&"','"&gzdw&"','"&bhwt&"','"&bhda&"')"
rs.open sql,conn,1,3
if not rs.eof then 
Response.write("&TS_asp=已有此人" ) 
else
conn.execute(addsql) 
Response.write("&TS_asp=成功注册" ) 
end if
end function
%>
<% function fd()
username=trim(Request("FDZH_fl"))
sql="select * from yhxx where username='"&username&"'" 
rs.open sql,conn,1,3
if not rs.eof then 
fdwt=rs("bhwt")
Response.write("&fdwt_asp="+ fdwt)
end if 
end function
%>
<%
function bj()
username=trim(Request("FDZH_fl"))
fdda=trim(Request("FDDA_fl"))
sql="select * from yhxx where username='"&username&"'" 
rs.open sql,conn,1,3
if not rs.eof then 
if fdda=rs("bhda") then
fdpaswd=rs("passwd")
Response.write("&fdpd_asp="+ fdpaswd)
Response.write("&TS_asp=找到答案")
else 
Response.write("&TS_asp=没有找到答案")
end if 
else 
Response.write("&TS_asp=没有此账号")
end if
end function
%>
<%
rs.close
'释放记录集对象rs
set rs=nothing
'关闭打开的连接
conn.close
'释放连接对象conn
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -