请教高手,下面代码的意思,谢谢了!!

来源:百度知道 编辑:UC知道 时间:2024/06/30 16:48:35
<!-- #include file="conn.asp" -->
<%
trim(replace(request("username"),"'",""))
if request.form("username")="" then
response.write "<script language=javascript>alert('请输入用户名!');history.back(-1);</script>"
response.end ()
end if
if request.form("password")="" then
response.write "<script language=javascript>alert('请输入密码!');history.back(-1);</script>"
response.end ()
end if
username=trim(replace(request("username"),"'",""))
password=trim(replace(request("password"),"'",""))
sql="select * from admin where adminuser='"&username&"' and adminpwd='"&password&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1

<!-- #include file="conn.asp" -->
<%
trim(replace(request("username"),"'",""))
if request.form("username")="" then
response.write "<script language=javascript>alert('请输入用户名!');history.back(-1);</script>"
response.end ()
end if
if request.form("password")="" then
response.write "<script language=javascript>alert('请输入密码!');history.back(-1);</script>"
response.end ()
end if //从上到这里是说如果用户名和密码为空是进不去的,要求你输入用户名和密码
username=trim(replace(request("username"),"'",""))
password=trim(replace(request("password"),"'","")) //这里是替换函数将原空的被你输入的字符替换掉
sql="select * from admin where adminuser='"&username&"' and adminpwd='"&password&"'" //这是SQL查询语句看你输入的用户名和密码和数据库的是否一致