Print Page | Close Window

Help!, Want to iclude file in Header.inc

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=2368
Printed Date: 31 March 2026 at 1:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help!, Want to iclude file in Header.inc
Posted By: wrang
Subject: Help!, Want to iclude file in Header.inc
Date Posted: 02 May 2003 at 7:33am
Hello I want to include file in the the file header.inc
<!-- #include file="xx.asp" -->
But when i do that i came up a error message
Active Server Pages error 'ASP 0126'
Include file not found
/database/forum_test/header.inc, line 169
The include file 'banners/include/admentor3.asp' was not found.

But the file admentor3.asp is on the server, But it still came upp this error message!!

How do i put a <!-- #include file="X.asp" --> in the forum

Help me please



Replies:
Posted By: pedalcars
Date Posted: 02 May 2003 at 7:38am
*Where* on the server is the file?

Try <!--#include virtual="/banners/include/admentor3.asp"-->

If you've missed the first "/", it will be looking for a directory called "banners" within the forum directory.

-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels



Posted By: wrang
Date Posted: 02 May 2003 at 8:22am
Hello
The file I want to include is in the main site.
But when i test with
 
<!--#include virtual="../../banners/include/admentor3.asp"-->
It still came up the error message
Active Server Pages error 'ASP 0126'
Include file not found
/database/forum_test/header.inc, line 169
The include file 'admentordb2.asp' was not found.
In the forum i want to display a file caled huvud.asp witch lays in the main so I will put the link <!--#include virtual="../../huvud.asp"-->
And in this file I have the link to the banners
<!--#include file="banners/include/admentor3.asp"-->

And now the error pop up agin
 Include file not found
/database/forum_test/header.inc, line 170
The include file 'banners/include/admentor3.asp' was not found.


But the file is still there
Hope u can understand what I meant



Posted By: michael
Date Posted: 02 May 2003 at 8:38am
You need to understand how includes work. There are relative and absolute includes.
Absolute: <!--#Include Virtual="dir/file.asp"-->
Relativ   : <!--#Include File="file.asp"-->
The difference is that absolute includes always go from the root of your website so if you want to include a file located in e.g. http://www.mysite.com/home/includes/file.asp - http://www.mysite.com/home/includes/file.asp you would always write an absolute statement like that:
<!--#Include Virtual="home/includes/file.asp"-->  no matter where you are calling it from.
If you decide to use relative includes it will include it from where you are calling it. so if the calling page is in let's say ../home/app/default.asp and you would like to include the very same file as before you would have to write <!--#Include File="../includes/file.asp"--> Now if you have this file calling another include so if file.asp is calling an include by itself you need to go relative from the include file and not from the first requesting page. For this reason and confusion it is always recommended to use absolute includes because it does not matter where you make the call from. In an application like this forum though it would be almost impossilbe as you never know where people put the forum. so relativ is used.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



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