骚年,表玩ASP了,换一个吧,比如PHP或是Ruby、Python啥的,就算喜欢微软的,也应该玩ASP.net啦######不行,我需要ASP啊######
基本的语法错了,VB或ASP是用不到“{}”的,比如:
IF()THEN
ELSE
ENDIF######那我那个应该怎么做吗我就是想做判断当前登陆的用户状态,如果状态等于0就执行删除语句,否则提示没有权限头大的很######你的<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">isdel始终是0######应该怎么做吗帮帮我吗######
不知道你是要做什么,至少要把VBScript弄懂吧,然后到网上查查如果访问数据库吧。
已经N年不用这个东西了######dimuser,isdel
user=request.form("username")
<spanstyle="color:#E53333;">isdel=-1
setrs=server.createobject("adodb.recordset")
<spanstyle="color:#E53333;">rs.open"select
fromadminwhereusername='"&user&"'",conn,1,1<spanstyle="color:#E53333;">''''获取isdel字段的值<spanstyle="color:#E53333;">ifnotrs.eofthen<spanstyle="color:#E53333;"> isdel=rs("isdel")<spanstyle="color:#E53333;">endif if(isdel=0)then conn.execute("Deletefrom[order]whereid="&Request("id")&"") Response.redirect"order.asp" else response.write"<script>alert('你没有权限!');location.endif注意:想一下isdel为什么设置成-1或其它非0字符或数值######感觉不是ASP。ASP的IF都不用()。应该是.net。######这语法,vbscript混合jscript,实在是无力吐槽啊。######<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">dimuser,isdel <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> user=request.form("username") <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> isdel=0 <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">setrs=server.createobject("adodb.recordset") <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">rs.open"selectfromadminwhereusername='"&user&"'andisdel='"&isdel&"'",conn,1,1
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"><spanstyle="color:#E53333;"> if(<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;color:#E53333;">rs("isdel") <spanstyle="color:#E53333;">=0)then
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> {
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> conn.execute("Deletefrom[order]whereid="&Request("id")&"")
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> Response.redirect"order.asp"
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> }
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> else
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> {
<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> response.write"<script>alert('你没有权限!');location.>
}
<spanstyle="color:#E53333;">endif######判断用户是否登录一般都用session或cookies