Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Asp Include file from Parent directory

Posted on 2006-06-16
2
Medium Priority
?
637 Views
Last Modified: 2013-11-18
Active Server Pages error 'ASP 0131'

Disallowed Parent Path

/www/folder/home.asp, line 2

The Include file '../index.asp' cannot contain '..' to indicate the parent directory.

******************************
I have been using information from : http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_10354572.html?query=asp+include+a+file+in+parent+directory&clearTAFilter=true 

I am trying to get a file from the parent directory to include. Can anyone tell me why it is working for some people and not me?

<!--#include file="../index.asp"-->
0
Comment
Question by:cipiWeb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
basicinstinct earned 600 total points
ID: 16919250
From here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q226474

RESOLUTION
The best solution to the problem is to use absolute virtual paths from the root of the Web site instead of relative paths.

For example, if you use an include file named "mycode.inc" at the root of your server, the virtual path would be "/mycode.inc." If you use the same include file in a virtual directory named "/includes" on your server, the virtual path would be "/includes/mycode.inc."

The syntax example below illustrates how to implement virtual paths:

<!--#include virtual="/<virtual path>/<filename.ext>"-->
                              

An alternative to using absolute virtual paths is to enable parent paths; however, this is not the preferred method. (See the notes in the More Information section for details.) This is accomplished for your default Web site by using the following steps:
1.      Open the Internet Services Manager in the Microsoft Management Console (MMC).
2.      Right-click on your Default Web Site and select Properties.
3.      Click the Home Directory tab.
4.      Click the Configuration button.
5.      Click the App Options tab.
6.      Click to select the Enable Parent Paths checkbox.
7.      Click the OK button until you return to the MMC.
0
 

Author Comment

by:cipiWeb
ID: 16919459
Awesome, it works. (ended up turning on parent paths.) but I would still like to make sure I understand the virtual includes, mainly... how do they differ from file?

This is a wild guess, but does file work relative to the file with the include script and virtual works relative to the domain root?

What is the difference between a virtual directory and a real directory? ( Folder )
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question