what is the difference of include virtual and incl

Results 1 to 3 of 3

Thread: what is the difference of include virtual and incl

  1. #1
    Join Date
    Dec 1969

    Default what is the difference of include virtual and incl

    i was just wondering what is the difference between the include file and an include file could somebody explain it in a technical manner, Thank You

  2. #2
    Karl Guest

    Default RE: what is the difference of include virtual and

    "The difference between include file and include file" ??? hopefully you mean include file and include virtual.<BR><BR>it indicates whether the given directory is a virtual path of a physical one.<BR><BR>A virtual path is a path with relation to the root of the server, wherease a file path, of physical path, is with relation to the calling page.<BR><BR>Physical paths are complicated because you can trace a file through multiple physical paths - but only 1 virtual path. The reason people tend to use physical paths though is because it is not dependent on your current location within a directory structure.<BR><BR>The answer you are problem looking for is as follows:<BR><BR>if I&#039m in c:inetpubwwwrootafolderdefault.asp<BR>and my include files are in c:inetpubwwwrootafolderinclude<BR><BR>then to include this file from default.asp I&#039d have to:<BR>using a virtual path<BR>&#060;!--INCLUDE VIRTUAL="/afolder/include/file.inc"--&#062;<BR><BR>using a file path<BR>&#060;!--INCLUDE FILE="/include/file.inc"--&#062;<BR><BR><BR>You can really see the difference when you compare those two include statement (coming from default.asp in the "afolder") to this file:<BR>c:inetpubwwwrootafolderafolder2default.as p<BR><BR>To use the include file from here we have to:<BR>Using virtual paths<BR>same as the one above!! Nothing changes, because the path to the include file from the root is the same!!<BR><BR>using a physical path<BR>&#060;!--INCLUDE FILE="../include/file.inc"--&#062;<BR><BR>As you should be able to clearly see, virtual paths are based on a common point -in the case of PWS and IIS that&#039s c:inetpubwwwroot. Whereas physical paths are relational to where you are currently located within a given directory structure.<BR><BR>--<BR>Karl

  3. #3
    Join Date
    Dec 1969

    Default RE: what is the difference of include virtual and

    &#060;#include file=""&#062; requires you to provide either a physical path to the file (i.e., "c:my documentsmyfile.txt") or it must reside in the current directory (or one of its subdirectories).<BR><BR>&#060;#include virtual=""&#062; allows you to include a file from your website by specifying the web virtual directory(i.e., "/includes/myfile.txt"), where the virtual folder "includes" could point to a physical folder residing anywhere in the file system.<BR><BR>Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts