手势密码图案大全步骤:asp 中if语句
来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 22:33:02
<%if session ("username")="" then%>
<!--#include file="fwqlb.asp"-->
<%else%>
<%
set rs=server.createobject("adodb.recordset")
sql="select Flag from Dv_User where UserName='"& session("username") &"'"
rs.open sql,conn,1,1
%>
<%
if rs("Flag")="2" then
%>
<!--#include file="ServerDPrice.asp"-->
<%
elseif rs("Flag")="3" then %>
<!--#include file="fwqlb.asp"-->
<%
else
%>
<!--#include file="DLPrice.asp"-->
<%end if%>
<%end if%>
<%if request.QueryString("action")="" then%>
<!--#include file="fwqlb.asp"-->
<%end if%>
<%if request.QueryString("action")="sousuo" then%>
<!--#include file="fwqss.asp"-->
<%end if%>
<%if request.QueryString("action")="leibiao" then%>
<!--#include file="fwqlb.asp"-->
<%end if%>
为什么我的rs("flag")=2的时候,还会再走rs("flag")=3下面的包含文件呢?
<!--#include file="fwqlb.asp"-->
<%else%>
<%
set rs=server.createobject("adodb.recordset")
sql="select Flag from Dv_User where UserName='"& session("username") &"'"
rs.open sql,conn,1,1
%>
<%
if rs("Flag")="2" then
%>
<!--#include file="ServerDPrice.asp"-->
<%
elseif rs("Flag")="3" then %>
<!--#include file="fwqlb.asp"-->
<%
else
%>
<!--#include file="DLPrice.asp"-->
<%end if%>
<%end if%>
<%if request.QueryString("action")="" then%>
<!--#include file="fwqlb.asp"-->
<%end if%>
<%if request.QueryString("action")="sousuo" then%>
<!--#include file="fwqss.asp"-->
<%end if%>
<%if request.QueryString("action")="leibiao" then%>
<!--#include file="fwqlb.asp"-->
<%end if%>
为什么我的rs("flag")=2的时候,还会再走rs("flag")=3下面的包含文件呢?
出现这样的情况,可能问题出在包含文件中
我觉得你可以换一种方式,不要用包含文件来做,用函数
举个例子:
<%
if session ("username")="" then
call fwqlb()
else
call other()
end if
%>
<%
sub fwqlb()
............
end sub
sub other()
............
end sub
%>
我觉得这样就比较清楚,也容易修改,个人建议~~
<!--#include file="$$$$$"--> 是不受条件限制的。。方法支持楼上
注意
<!--#include file=""-->
的执行顺序
IIS会在解释程序之前就读取包涵文件
回答者:bdtest 说得对。
<!--#include file=""--> 里面的所有包含文件都会被先执行。然后才会执行if 之类的