• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

How can I include files according to different conditions?

Hi all,

How can I include files according to different conditions? Thanks.
<%
if(payLoadType.equals("SMALL")){
       <%@ include file="test.txt" %>             //Could you please tell me the correct syntax to do that?
   }
else if(payLoadType.equals("MEDIUM")){
       <%@ include file="test.txt" %>
       <%@ include file="test.txt" %>  
   }
%>

0
jen2483
Asked:
jen2483
1 Solution
 
objectsCommented:
try:

<%
if(payLoadType.equals("SMALL")){
%>
       <%@ include file="test.txt" %>
<%
   }
else if(payLoadType.equals("MEDIUM")){
%>
       <%@ include file="test.txt" %>
       <%@ include file="test.txt" %>  
<%
   }
%>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now