It seems that you are using a mixture of FoxWeb 1 and FoxWeb 2 techniques, or you are using FoxWeb 1 and its sample scripts in conjunction with FoxWeb 2 documentation.
If you are not dealing with an existing FoxWeb application, then I recommend that you install FoxWeb 2 and work with the sample scripts in it, including ContactMine 2. This new version of ContactMine does not use MergeTxt, but rather uses FWX scripts.
If on the other hand you must use FoxWeb 1 for some reason, then you should also be using The FoxWeb 1 documentation, which was installed on your server with the software (you can also find it at
http://www.foxweb.com/document12).
To answer your specific question, MergeTxt only supports expressions, so you don't need to include the equal sign. The correct syntax for your example is:
<p>This page was served on <<datetime()>> |
FoxWeb Support Team support@foxweb.com email |
Sent by Gary Wood on 09/30/2002 09:08:55 AM:
I tried
<p>This page was served on <<=datetime()>>
in the merge file and it did not work.
Also, there were no samples of HTML with imbedded FoxPro code in the Contact Mine samples. Can you direct me to a sample that I can download?
thx..........Gary
PS I really like FoxWeb but I can't buy it until I get in running properly.
Sent by FoxWeb Support on 09/30/2002 01:42:58 AM:
The problem is your delimiters. The default delimiters for MergeTxt are << and >>, not <% and %>. In FoxWeb 2, you can change this, but then again, you don't need to be using the MergeTxt function in FoxWeb 2.
FoxWeb Support Team support@foxweb.com email |
Sent by Gary Wood on 09/28/2002 01:20:59 PM:
FoxWeb Support,
I found one problem:
html_out = MergeTxt(ReadFile('main_menu.frx'))
should be
html_out = MergeTxt(ReadFile('main_menu.mrg'))
but my browser output still doesn't recognize the FoxPro code inside the <% blah blah %>. It appears in the browser as:
Time Card Menu
Employee: Gary Wood
Company: General Motors of Canada
This page was served on <%=DATETIME()%>.
thanks.............Gary
Sent by Gary Wood on 09/28/2002 08:42:29 AM:
When I do a Rebuild Project with Recompile all files on I get the following error message:
Program c:\program files\foxweb\programs\epay\main.prg has the following errors:
Unknown READFILE - Undefined
Unknown MERGETXT - Undefined
Unknown URLENCODE - Undefined
The ContactMine sample works fine.
When I run mine I get:
Error in CGI Back-End Program
There was an error during execution of the Back-End CGI program. The error is:
User program produced no output.
Here is the program:
******************************************
* MAIN.PRG 1.0 *
******************************************
* Constants
#DEFINE RECORDS_PER_PAGE 10
#DEFINE CRLF CHR(13) + CHR(10)
******************************************
PROCEDURE main
STORE "1" to ee
STORE "" to eename, co_id, company
USE C:\epay\employee.dbf ORDER EE_ID
SET EXACT OFF
STORE ee TO gcSeekVal
SEEK gcSeekVal
IF FOUND( )
STORE ALLTRIM(first_name) + " " + ALLTRIM(last_name) to eename
STORE employee.company to gcSeekVal
USE C:\epay\company.dbf ORDER company_id
SEEK gcSeekVal
IF FOUND( )
STORE ALLTRIM(company.name) to company
ENDIF
ENDIF
html_out = MergeTxt(ReadFile('main_menu.frx'))
RETURN
The merge file is:
Content-type: text/html
<HTML>
<HEAD>
<TITLE>Gary's Timecard Main Menu</TITLE>
<LINK REL=stylesheet HREF="style.css" TYPE="text/css">
</HEAD>
<body bgcolor="#cccccc">
<h1>Time Card Menu</h1>
<p>Employee: <<eename>><br>
<p>Company: <<Company>>
<p>This page was served on <%=DATETIME()%>.
<p>
<p>
<p>
</BODY>
</HTML>
Is this a programming problem or a setup problem??
Gary