请教,这段代码怎么改成一个循环,就是一个条件成立后就不往下执行了.望高手赐教!!
<%
'VIP用户
dim username
username=trim(request.Cookies("shopv8")("username"))
if request.Cookies("shopv8")("reglx")=2 then
response.write ""&rs("zhuang2")&""
else
response.write "<br> <br>"
end if
%>
<%
'收费用户
username=trim(request.Cookies("shopv8")("username"))
if request.Cookies("shopv8")("reglx")=999 then
response.write ""&rs("zhuang3")&""
else
response.write "<br> 你还没注册?或者没有登录?这篇文章要求至少是本站的注册用户才能阅读!<br><br>"
response.write " 如果你还没注册,请赶紧<a href='Reg.asp'><font color=red>点此注册</font></a>吧!<br><br>"
response.write " 如果你已经注册但还没登录,请赶紧<a href='Login.asp'><font color=red>点此登录</font></a>吧!<br>"
response.write " 对不起,你的权限不够,不能阅读此文章!<br><br><br><br>"
end if
%>
<%
'白金会员
username=trim(request.Cookies("shopv8")("username"))
if request.Cookies("shopv8")("reglx")=99 then
response.write ""&rs("zhuang4")&""
else
response.write ""
end if
%>
<%
'钻石会员
username=trim(request.Cookies("shopv8")("username"))
if request.Cookies("shopv8")("reglx")=9 then
response.write ""&rs("zhuang5")&""
else
response.write "<br> <br>"
end if
%>
參考答案:'*****************************************************
'* Author:xudeng0129
'* Time:07-1-23
'* PS:if u think u can, nothing is impossible!
'*****************************************************
Dim strAllWords,username
strAllWords=""
username=trim(request.Cookies("shopv8")("username"))
Select Case request.Cookies("shopv8")("reglx")
Case 2 'VIP用户
strAllWords=rs("zhuang2")
Case 999 '收费用户
strAllWords=rs("zhuang3")
Case 99 '白金会员
strAllWords=rs("zhuang4")
Case 9 '钻石会员
strAllWords=rs("zhuang5")
Case Else
strAllWords="<br> 你还没注册?或者没有登录?这篇文章要求至少是本站的注册用户才能阅读!<br><br>"&Chr(13)&Chr(10)&_
" 如果你还没注册,请赶紧<a href='Reg.asp'><font color=red>点此注册</font></a>吧!<br><br>" &Chr(13)&Chr(10)&_
" 如果你已经注册但还没登录,请赶紧<a href='Login.asp'><font color=red>点此登录</font></a>吧!<br>" &Chr(13)&Chr(10)&_
" 对不起,你的权限不够,不能阅读此文章!<br><br><br><br>"
End Select
Response.Write strAllWords