Date:  04/07/2006 06:40:01 AM Msg ID:  002904
From:  Ali Koumaiha Thread:  002903
Subject:  Re: Include FoxWeb Code
Joe,  how are you?
 
Put the txt file outside the program area and it should work.  I just tested similar example to yours.  However, since it is a txt, it cannot be inside the program folder of the foxweb since it will be compiled.  It is similar to the CSS file and other static file.
Sent by Joe Goldsmith on 04/06/2006 08:06:19 PM:
I have a login script and use SETVAR to carry some information from one page to another. I also have a header script in txt format where I use FILETOSTR to insert the header script. And, the header script has some FoxWeb code. The problem is that the FoxWeb code included header script does not work. I now understand that the txt header script file cannot be compiled so the FoxWeb code does not work when inserted using the FILETOSTR function. Would anyone have an idea as to how to insert a header script wile FoxWeb code into another script? Example:
 
*Login script
*Get user name
<%Session.SetVar("gFNAME","Joe")%>
 
*Include.txt
<%Response.Write("Name: "+lcName)%>
 
Another Script Inserting File
<%
lcName=Session.GetVar('gFNAME')
*Line below prints out the label name and the value of lcName
Response.Write("Name: "+lcName)
 
<%=FILETOSTR('include.txt')%>
*Nothing is written but expect "Name: Joe" to be written
%>
 
Anyone know how to insert a file with FoxWeb Script so that the FoxWeb script in the inserted file works?
 
Joe