Print Page | Close Window

Include

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2786
Printed Date: 29 March 2026 at 8:18am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Include
Posted By: Mart
Subject: Include
Date Posted: 17 May 2003 at 3:26am

Hi, includes work fine when you use

<!--#include file="config.asp" -->

But it doesn't work for

<!--#include virtual="config.asp" -->

Whats the problem?

Thanks, Martin.




Replies:
Posted By: dj air
Date Posted: 17 May 2003 at 4:21am
Originally posted by Mart Mart wrote:

Hi, includes work fine when you use

<!--#include file="config.asp" -->

But it doesn't work for

<!--#include virtual="config.asp" -->

Whats the problem?

Thanks, Martin.

<!--#include virtual="config.asp" --> =

from root scructure ie /aaa/config so it would be

<!--#include virtual="/aaa/config.asp" -->

with <!--#include file="config.asp" --> is used for the directory you are in or if you want it in a directory below that folder or above you sue the ../ or aaa/ last one is the folder name

so for the virtual one above start with the /



Posted By: ljamal
Date Posted: 17 May 2003 at 8:33am
Virtual starts in the root directory and moves from there.
File starts in the current directory and moves from there.

If your structure is

C:\inetpub\wwwroot\directory\subdirectoty
and you are in directory and trying to include a file in subdirectory then it would be

file="subdirectory/file.inc" or
virtual = "directory/subdirectory/file.inc"

I personally use virtual because even if the file change in relation to each other, I rarely change them in relation to the root directory. Most of my includes file end up in a "inc" directory off the root any way.


Posted By: Mart
Date Posted: 18 May 2003 at 9:48am
Ok that works now, but whats the differance between virtual and file anyway?


Posted By: ljamal
Date Posted: 18 May 2003 at 10:00am
The only difference is where the parser looks for the directory. As I said above with "virtual" it starts at the root and with "file" it starts with the current directory.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net