Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Dynamic Includes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic Includes

 Post Reply Post Reply Page  <12
Author
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 16 June 2003 at 12:07am

You can't pass variables through an include statement, however, any variables available to the page that contains the include statement are available to the included page.

e.g. page1.asp includes page2.asp

If you call page1.asp as -  page1.asp?MyVar=x

MyVar is available in page2.asp

I use something similar for handling logins to return them to the initial page they tried to access.

 



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 16 June 2003 at 5:39pm

that's impossible. thats like saying that your going to mail somthing somewhere and the address is avaliable at the destination, ain't gonna happen.

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 16 June 2003 at 6:22pm
Originally posted by pmormr pmormr wrote:

that's impossible. thats like saying that your going to mail somthing somewhere and the address is avaliable at the destination, ain't gonna happen.

He/she just posted an example of how to pass the var from page1 to page2 and he said that the var will be available on page two, not that the var is on page 2, so it is possible, however it won't help to make the site skinnable......

FeRnAN
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 June 2003 at 11:25am
oh, i misunderstood you. you want to pass a variable to page 2 from page1. I though you wanted to use a variable from page two to redirect to page two. Sorry.
Back to Top
FatOtis View Drop Down
Newbie
Newbie


Joined: 20 April 2003
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote FatOtis Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2003 at 2:55am

Should This Work:

 

<%
Dim SkinNo
SkinNo = Request.Cookies("Skin")

If SkinNo <> "" Then
 SkinNo = "1"
 Response.Cookies("Skin") = "1"
Else
  SkinNo = Request.Cookies("Skin")
End If

Response.Write ("Skin:"& SkinNo)
Server.Execute("skin/"& SkinNo &"/header.inc")
%>

    <!--#INCLUDE file="pagecontent.inc" -->


<% Server.Execute("skin/"& SkinNo &"/footer.inc") %>

 

    ...becasue it dosent


 

Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2003 at 10:35am

Why not just skin it with CSS? Or just use the script at http://alistapart.com for skins (again CSS)?

Select... Case  works better than If... Then...

Back to Top
FatOtis View Drop Down
Newbie
Newbie


Joined: 20 April 2003
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote FatOtis Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2003 at 12:16pm

Fine then...

<%
Dim SkinNo
Dim SkinChange

SkinNo = Request.Cookies("Skin")

SkinChange = CLng(Request.QueryString("skin"))

If SkinChange <> "" Then
     Response.Cookies("Skin") = SkinChange
     SkinNo = SkinChange
End If

Select Case SkinNo
  Case 1
     Response.Cookies("Skin") = 1
     Server.Execute("skin/1/header.inc")
  Case 2
     Response.Cookies("Skin") = 2
     Server.Execute("skin/2/header.inc")
  Case Else
     Response.Write ("No Skin Selected"& SkinNo)
     SkinNo = CLng(Request.QueryString("Skin"))
     'Response.Cookies("Skin") = SkinNo
End Select


Response.Write (SkinChange &" - SkinChange <br>")
Response.Write (Skin &" - Skin <br>")

%>

 

...and yeah, I'll prboally just go with CSS skining, I mainly just wanted to see if it could be done. It would appear not.

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.