Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - IF statement for different header?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

IF statement for different header?

 Post Reply Post Reply Page  12>
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Topic: IF statement for different header?
    Posted: 15 October 2004 at 2:06pm

How do I write the coding for different header?

where if idcategory=1 then it will load <!--#include file="header1.asp"-->

where if idcategory=2 then it will load <!--#include file="header2.asp"-->

Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 2:30pm
Category? That will be in default.asp
Back to Top
xeerex View Drop Down
Senior Member
Senior Member


Joined: 19 November 2002
Location: United States
Status: Offline
Points: 601
Post Options Post Options   Thanks (0) Thanks(0)   Quote xeerex Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 3:31pm
Here we go with dynamic includes again...

Here's a [ search ] to help you out.

In short, the includes are processed prior to other script so in theory it is impossible to make them dynamic. However, there are ways "around" it.
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 4:34pm

Sorry, may be I'm confusing everyone here.
Actually, I'm not talking about editing this forum.
So, the file is actually not in the "includes" folder.

I was just wonder how would I write the coding. Something like these? (this page is not in the includes folder)

If idCategory="1" then
   <!--#include file="header1.asp"-->
end if

If idCatgory="2" then
   <!--#include file="header2.asp"--> 
end if

 

Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 5:10pm
You are not trying to edit the forums, but then you say you want to do that? Now I'm confused, so do you want or do you not want to edit the forums and make your (If Cat...) change?

Any way, if you want to make the change, the file you want to edit is default.asp in your root.

Your approach will not work, search these forums for dynamic includes and read a bit about it to find out why.
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 5:45pm

The files I'm trying to modify is actually from another asp software.
Sorry for the confusing.

May be I don't exactly know what I'm talking about.. but this is want I want to achieve.  See how every category has different header? that is what I want.
http://www.cb2.com/



Edited by Lucent
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 6:10pm
<%
if CatID = 1 then
%>
<!--#include file="filename"-->
<%
elseif CatID = 1 then
%>
<!--#include file="filename"-->
<%
end if
%>
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2004 at 6:45pm
nop.. didn't work..
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.