asp用户登录
看看我的代码错在哪??????<%setconn=server.createobject("adodb.connection")conn.open"driver={mic...
看看我的代码错在哪??????
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("user.mdb")
username=request.form("usename")
password=request.form("password")
if username="" or password="" then
response.write ("<script language=javascript>alert'用户名和密码不能为空!';history.go(-1);</script>")
else
set rs=Createobject("adodb.connection")
sql="select * from user"
rs.open.sql conn,1,1
if username=rs("username") and password=rs("password") then
response.redirct "login.asp"
else
response.write ("<script language=javascript>alert'用户名或密码输入错误,请确认!';history.go(-1);</script>")
%>
<%end if%>
<%end if%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
为什么会出现下面的错误:
Active Server Pages 错误 'ASP 0116'
丢失脚本关闭分隔符
/login/next.asp,行 1
Script 块缺少脚本关闭标记(%>)。
知道的帮忙看下!小弟在此谢过.
为什么改了以后输入用户名和密码会弹出
"用户名或密码不能为空!" 展开
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("user.mdb")
username=request.form("usename")
password=request.form("password")
if username="" or password="" then
response.write ("<script language=javascript>alert'用户名和密码不能为空!';history.go(-1);</script>")
else
set rs=Createobject("adodb.connection")
sql="select * from user"
rs.open.sql conn,1,1
if username=rs("username") and password=rs("password") then
response.redirct "login.asp"
else
response.write ("<script language=javascript>alert'用户名或密码输入错误,请确认!';history.go(-1);</script>")
%>
<%end if%>
<%end if%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
为什么会出现下面的错误:
Active Server Pages 错误 'ASP 0116'
丢失脚本关闭分隔符
/login/next.asp,行 1
Script 块缺少脚本关闭标记(%>)。
知道的帮忙看下!小弟在此谢过.
为什么改了以后输入用户名和密码会弹出
"用户名或密码不能为空!" 展开
展开全部
alert 后面要加()
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("user.mdb")
username=request.form("usename")
password=request.form("password")
if username="" or password="" then
response.write ("<script language=javascript>alert('用户名和密码不能为空!');history.go(-1);</script>")
else
set rs=Createobject("adodb.connection")
sql="select * from user"
rs.open.sql conn,1,1
if username=rs("username") and password=rs("password") then
response.redirct "login.asp"
else
response.write ("<script language=javascript>alert('用户名或密码输入错误,请确认!');history.go(-1);</script>")
%>
<%end if%>
<%end if%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("user.mdb")
username=request.form("usename")
password=request.form("password")
if username="" or password="" then
response.write ("<script language=javascript>alert('用户名和密码不能为空!');history.go(-1);</script>")
else
set rs=Createobject("adodb.connection")
sql="select * from user"
rs.open.sql conn,1,1
if username=rs("username") and password=rs("password") then
response.redirct "login.asp"
else
response.write ("<script language=javascript>alert('用户名或密码输入错误,请确认!');history.go(-1);</script>")
%>
<%end if%>
<%end if%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询