大家帮我看看这个是怎么回事?语法错误?
这个是原代码
<!--#include file="conn.asp"-->
<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
sql="select username,password,flag from admin where password='"&password&"' and username='"&username&"'"
set rs = conn.execute(sql)
if not(rs.bof and rs.eof) then
if password=rs(1) then
session("admin")=rs(0)
session("flag")=rs(2)
Response.Redirect "main.asp"
else
call Error
end if
else
call Error()
end if
sub Error()
response.write " <br><br><br>"
response.write " <table align='center' width='300' border='1' cellpadding='0' cellspacing='0' bordercolor='#999999'>"
response.write " <tr bgcolor='#999999'> "
response.write " <td colspan='2' height='15'> "
response.write " <div align='center'><font color='#FFFFFF'>操作: 确认身份失败!</font></div>"
response.write " </td>"
response.write " </tr>"
response.write " <tr> "
response.write " <td colspan='2' height='23'> "
response.write " <div align='center'><br><br>"
response.write " 用户名或密码错误!!! <br><br>"
response.write " <a href='javascript:onclick=history.go(-1)'>返回</a>"
response.write " <br><br></div></td>"
response.write " </tr> </table>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
我仅仅连接个CSS样式表就会出错,代码如下
<!--#include file="conn.asp"-->
<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
sql="select username,password,flag from admin where password='"&password&"' and username='"&username&"'"
set rs = conn.execute(sql)
if not(rs.bof and rs.eof) then
if password=rs(1) then
session("admin")=rs(0)
session("flag")=rs(2)
Response.Redirect "main.asp"
else
call Error
end if
else
call Error()
end if
sub Error()
response.write " <html> "
response.write " <head> "
response.write " <title>身份确认失败</title> "
response.write " <link href="../../css/css.css" rel="stylesheet" type="text/css"> "
response.write " </head> "
response.write " <body> "
response.write " <br><br><br>"
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class="biaoge">"
response.write " <td height='15' colspan='2' bgcolor="#FFC8D2" class="biaogeBottom">
response.write " <div align="center"><strong>操作: 确认身份失败!</strong></div>"
response.write " </td>"
response.write " </tr>"
response.write " <tr> "
response.write " <td colspan="2" height="23"> "
response.write " <div align="center"><br><br>"
response.write " 用户名或密码错误!!! <br><br>"
response.write " <a href="javascript:onclick=history.go(-1)">返回</a>"
response.write " <br><br></div></td>"
response.write " </tr> </table>"
response.write " </body>"
response.write " </html>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
请问是怎么回事?
问题点数:20、回复次数:9Top
1 楼wmcode(欧阳乐天)回复于 2005-06-18 13:11:54 得分 0
改成:
response.write "<link href='../../css/css.css' rel='stylesheet' type='text/css'> "
错误原因:"嵌套产生混乱Top
2 楼txwdcom(冷月孤星)回复于 2005-06-18 13:17:54 得分 0
按照你的改了,结果。。
Microsoft VBScript 编译器错误 错误 '800a0401'
语句未结束
/lyhome/wz/admin/Chkadmin.asp,行33
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class="biaoge">"
--------------------------------------------------------------------------------------------------------^
Top
3 楼txwdcom(冷月孤星)回复于 2005-06-18 13:20:54 得分 0
改成这样了,还是不行
<!--#include file="conn.asp"-->
<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
sql="select username,password,flag from admin where password='"&password&"' and username='"&username&"'"
set rs = conn.execute(sql)
if not(rs.bof and rs.eof) then
if password=rs(1) then
session("admin")=rs(0)
session("flag")=rs(2)
Response.Redirect "main.asp"
else
call Error
end if
else
call Error()
end if
sub Error()
response.write " <html> "
response.write " <head> "
response.write " <title>身份确认失败</title> "
response.write "<link href='../../css/css.css' rel='stylesheet' type='text/css'> "
response.write " </head> "
response.write " <body> "
response.write " <br><br><br>"
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class='biaoge'>"
response.write " <td height='15' colspan='2' bgcolor='#FFC8D2' class='biaogeBottom'>
response.write " <div align="center"><strong>操作: 确认身份失败!</strong></div>"
response.write " </td>"
response.write " </tr>"
response.write " <tr> "
response.write " <td colspan='2' height='23'> "
response.write " <div align='center'><br><br>"
response.write " 用户名或密码错误!!! <br><br>"
response.write " <a href='javascript:onclick=history.go(-1)'>返回</a>"
response.write " <br><br></div></td>"
response.write " </tr> </table>"
response.write " </body>"
response.write " </html>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
Top
4 楼wggipkhgef(不想说乔丹)回复于 2005-06-18 13:36:01 得分 0
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class="biaoge">"
改为
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class='biaoge'>"
Top
5 楼wggipkhgef(不想说乔丹)回复于 2005-06-18 13:37:07 得分 0
最后的class也要单引号,呵呵,这种错误太常见了Top
6 楼txwdcom(冷月孤星)回复于 2005-06-18 13:40:10 得分 0
改成这样了,还是不行
<!--#include file="conn.asp"-->
<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
sql="select username,password,flag from admin where password='"&password&"' and username='"&username&"'"
set rs = conn.execute(sql)
if not(rs.bof and rs.eof) then
if password=rs(1) then
session("admin")=rs(0)
session("flag")=rs(2)
Response.Redirect "main.asp"
else
call Error
end if
else
call Error()
end if
sub Error()
response.write " <html> "
response.write " <head> "
response.write " <title>身份确认失败</title> "
response.write "<link href='../../css/css.css' rel='stylesheet' type='text/css'> "
response.write " </head> "
response.write " <body> "
response.write " <br><br><br>"
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class='biaoge'>"
response.write " <td height='15' colspan='2' bgcolor='#FFC8D2' class='biaogeBottom'>
response.write " <div align="center"><strong>操作: 确认身份失败!</strong></div>"
response.write " </td>"
response.write " </tr>"
response.write " <tr> "
response.write " <td colspan='2' height='23'> "
response.write " <div align='center'><br><br>"
response.write " 用户名或密码错误!!! <br><br>"
response.write " <a href='javascript:onclick=history.go(-1)'>返回</a>"
response.write " <br><br></div></td>"
response.write " </tr> </table>"
response.write " </body>"
response.write " </html>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
已经都改了啊,为什么还是不行?500错误Top
7 楼cssddnn2()回复于 2005-06-18 14:03:26 得分 0
我买了一个 便宜的 asp.net空间!才50元!高兴!给分!!
100mb 的!可以做论坛!才 50元!!速度飞快!
www.hi876.com 你们看看Top
8 楼txwdcom(冷月孤星)回复于 2005-06-18 16:49:48 得分 0
帮我看看,为什么还是不行啊?Top
9 楼Renxiang0731(小柳)回复于 2005-06-18 20:01:18 得分 20
你按这个改下看:
<!--#include file="conn.asp"-->
<%
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
username=replace(username," ","")
password=replace(trim(Request("password")),"'","")
password=replace(password," ","")
sql="select username,password,flag from admin where password='"&password&"' and username='"&username&"'"
set rs = conn.execute(sql)
if not(rs.bof and rs.eof) then
if password=rs(1) then
session("admin")=rs(0)
session("flag")=rs(2)
Response.Redirect "main.asp"
else
call Error
end if
else
call Error()
end if
sub Error()
response.write " <html> "
response.write " <head> "
response.write " <title>身份确认失败</title> "
response.write " <link href='../../css/css.css' rel=stylesheet> "
response.write " </head> "
response.write " <body> "
response.write " <br><br><br>"
response.write " <table width='300' border='0' align='center' cellpadding='0' cellspacing='0' class='biaoge'>"
response.write " <td height='15' colspan='2' bgcolor='#FFC8D2' class='biaogeBottom'>"
response.write " <div align='center'><strong>操作: 确认身份失败!</strong></div>"
response.write " </td>"
response.write " </tr>"
response.write " <tr> "
response.write " <td colspan='2' height='23'> "
response.write " <div align='center'><br><br>"
response.write " 用户名或密码错误!!! <br><br>"
response.write " <a href='javascript:onclick=history.go(-1)'>返回</a>"
response.write " <br><br></div></td>"
response.write " </tr> </table>"
response.write " </body>"
response.write " </html>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
Top




