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
Author
ptetz View Drop Down
Newbie
Newbie
Avatar

Joined: 25 August 2003
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ptetz Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Includes
    Posted: 25 August 2003 at 4:44pm

Hi there,

I'm trying to create a website that is completely database driven (MSAccess) using VBScript.  How can I pull the following text from a field in the database:
<!-- #include file="includes/header.asp" -->


and have it run through the server to generate the header using the include statement, versus just having the include statement print (basically make it work?)?  Does this make sense??

I currently have a file called tblpages.asp that extracts all the information needed to build a page and this stores the information into variables - which I know doesn't work, but I can't wrap my head around how to make it work (i.e. my table includes txt_Title, txt_Keywords, , txt_Description, txt_Header, txt_Left, txt_Content, txt_Right, txt_Footer).  Anything that is text only in my tables works, but anything that is an include statement doesn't.

Sample code of my default.asp page:

<!-- #include file="includes/tblpages.asp" -->
(extract variables from database)

<html>
<head>
    <title><%= txt_Title %></title>
    <meta name=Keywords content="<%= txt_Keywords %>">
    <meta name=Description content="<%= mem_Description %>">
    <link rel="stylesheet" href="<%= txt_Stylesheet %>" type="text/css">   
</head>
<body>
<table width="760" height="100%" border=0 cellspacing=3 cellpadding=3>

  <tr valign="top">

    <!-- Top Banner -->
        <td colspan=2>
            <% =txt_Header %>
(this is the include statement which doesn't work)
        </td>
  </tr>



Thanks!

Paula

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: 25 August 2003 at 5:38pm
You can't pull an include file from a database because includes are processed and included before the script runs.
Back to Top
ptetz View Drop Down
Newbie
Newbie
Avatar

Joined: 25 August 2003
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ptetz Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2003 at 9:38pm

Yes...I understand that includes are processed before the script runs, as I stated in my original post and that's why I'm asking how to work around it.  I gave my example code so that people could see what I was trying to accomplish.

I've read a bit about the FileSystemObject object...can anybody provide input about using this object somehow??

Thanks.

Back to Top
vshriniwasan View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2001
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote vshriniwasan Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 11:28am

There is no workaround for this. Mainly because the server has already processed the information that is in the page and now only thing left is printing. If you do include, it will be a comment in that area rather than bringing in the info.

I would rather suggest doing it as template. Have a template file, where all the structure is located. Than pull the info in. You can keep the info in a XML or an include file. I understand you want to do only VB. But this might be an option for you.

Last IDEA I can think is using FSO to create, edit and write to a file. Being that is a full file, it does bring in the includes.

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

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 12:39pm
I posted this on my site last nite, its a script for dynamic includes, read the post at http://www.invisionportal.com/forum/forum_posts.asp?TID=1345&PN=1
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 3:25pm

Originally posted by MadDog MadDog wrote:

I posted this on my site last nite, its a script for dynamic includes, read the post at http://www.invisionportal.com/forum/forum_posts.asp?TID=1345&PN=1

Yeah, but we have to sign up just to read the post there...



Edited by KCWebMonkey
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 3:56pm
Sorry, forgot i had that set. I made it so guests can view it.

http://www.invisionportal.com/forum/forum_posts.asp?TID=1345&PN=1
Back to Top
farrukh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2002
Location: Pakistan
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote farrukh Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2003 at 3:58pm
guys check this link
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7633&lngWId=4

post on above maddogs posts....
ahh nice way to restrict user to signup and see the topic
i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html
Back to Top
 Post Reply Post Reply

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.