Re: ASP and SSI include

by "Srinivasan Ramakrishnan" <srinivar(at)md3.vsnl.net.in>

 Date:  Fri, 20 Oct 2000 15:39:10 +0530
 To:  "Peter Benoit" <pbenoit(at)triton-network.com>,
"'Cyanide _7'" <leo7278(at)hotmail.com>,
<Mark.Charlton(at)sgcna.com>
 Cc:  <hwg-languages(at)hwg.org>
 References:  network
  todo: View Thread, Original
So can PHP::

<?
    if(file_exists("file.txt")){
        include("file.txt");
        // OR
        require("file.txt");
    }
?>

-Srini


----- Original Message ----- 
From: Peter Benoit <pbenoit(at)triton-network.com>
To: 'Cyanide _7' <leo7278(at)hotmail.com>; <Mark.Charlton(at)sgcna.com>
Cc: <hwg-languages(at)hwg.org>
Sent: Thursday, October 19, 2000 11:27 PM
Subject: RE: ASP and SSI include


> Which is why Cold Fusion is so cool, cause you can do all that in a one
> liner.  Like :
> 
> <cfif IsDefined('url.page')><cfinclude template='#url.page#'></cfif>
> 
> 
> 
> *  -----Original Message-----
> *  From: Cyanide _7 [mailto:leo7278(at)hotmail.com]
> *  Sent: Monday, October 16, 2000 3:07 PM
> *  To: Mark.Charlton(at)sgcna.com
> *  Cc: hwg-languages(at)hwg.org
> *  Subject: Re: ASP and SSI include
> *  
> *  
> *  this is what i use:
> *  <%
> *  SUB include(inc_file)
> *     Dim filesystem, textfile, filepath
> *     filepath = Server.mappath(inc_file)
> *     Set filesystem = Server.CreateObject("Scripting.FileSystemObject")
> *     IF filesystem.FileExists(filepath) THEN
> *       Set textfile = filesystem.OpenTextFile(filepath, 1)
> *       Response.write textfile.ReadAll
> *     ELSE
> *       Response.write "File " & inc_file & " not found."
> *     END IF
> *  END SUB
> *  %>
> *  
> *  and i include that in any file that needs to include the 
> *  contents of a file
> *  given an absolute or relative pathname. it basically opens 
> *  the file as a
> *  textfile, grabs the contents, and writes it to the document. 
> *  you'd use it
> *  like so:
> *  
> *  include Request("path") & "/" & Request("file")
> *  
> *  where path and file are the values sent via the querystring. 
> *  - Cyanide_7
> *  
> *  
> *   >Hi
> *   >
> *   >I am trying to dynamically include files/text into an ASP 
> *  page, based upon
> *   >querystring variables.
> *   >
> *   >I know the SSI is processed before the ASP code, and I 
> *  think I saw a
> *   >solution on the list sometime not too long ago, but I have 
> *  searched the
> *   >archive and cannot find it.
> *   >
> *   >Can someone point me towards a way I can build a dynamic 
> *  include page.
> *   >
> *   >The scenario is I have a directory structure
> *   >
> *   >0001 - file1T.txt
> *   >      - file1B.txt
> *   >      - file2T.txt
> *   >      - file2B.txt
> *   >0002 - file1T.txt
> *   >      - file1B.txt
> *   >      - file2T.txt
> *   >      - file2B.txt
> *   >      - file3T.txt
> *   >      - file3B.txt
> *   >...
> *   >
> *   >
> *   >and I get the directory (0001, 0002, ...) and file (file1, 
> *  file2, ...) from
> *   >the previous page, and there are an unlimited number of 
> *  directories, and
> *   >contained files.  I need to build a page which puts the 
> *  right file*T at the
> *   >top and file*B at the bottom of a page, with an image in 
> *  the middle, I can
> *   >include the image no problem, but I cannot get the text in.
> *   >
> *   >Thanks for your undoubtably invaluable help
> *   >Mark
> *   >
> *   >=============================================
> *   >Mark Charlton
> *   >Mailto:Mark.Charlton(at)sgcna.com
> *   >Phone: 508-795-2546
> *   >Fax: 508-795-5976
> *  
> *  _____________________________________________________________
> *  ____________
> *  Get Your Private, Free E-mail from MSN Hotmail at 
> http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
> 
> 
> 

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA