Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Including a Text File
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Including a Text File

 Post Reply Post Reply Page  12>
Author
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 Topic: Including a Text File
    Posted: 13 April 2003 at 7:39pm

I need to include a text file... the name is located in a database (example: myfile.txt). I know this won't work but this is what it would need to do
< !-- #inlcude virtual="/_jokestorage/<%myvariable%> -->
is there anyway to include the text file into the document using a variable as the file name?

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: 13 April 2003 at 9:15pm

didnt i answer this in another post?

anyways do this:

<% Server.Execute("/_jokestorage/" & myvariable) %>

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2003 at 7:04am

is....
< !-- #inlcude virtual="/_jokestorage/<%myvariable%> -->

and

<% Server.Execute("/_jokestorage/" & myvariable) %>

basically the same? does it do the same thing?

Back to Top
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2003 at 8:09am
No (not here at least) - As includes are included first, (before the scripts are run), you'd get an error because there wont be a file in the /_jokestorage/ folder named "<%myvariable%>"
www.pedalcars.info

The most fun on four wheels

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: 14 April 2003 at 8:55am
theres just one problem with using Server.Execute, theres nothing to EXECUTE! Its just one text file with some writing in it and the file name is dynamic.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2003 at 8:58am

ok, when i asked is "include" the same as "server.execute" i didnt mean the if i use ASP in the include

i ment if ya have a normal include like

<!--#include file="text.txt"-->

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2003 at 2:41pm
no it is not the same. server.execute is faster as it safes a roundtrip to the browser.
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: 14 April 2003 at 8:14pm
will server.execute have the same the effect of includes? It can't execute a text file that has nothing but text in it.
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.