
Also, review the official HTML 4.0 specification from the World Wide Web Consortium at:
http://www.w3.org/TR/REC-html40/
Another excellent idea is to append ".fm" to the end of the name of your database file. It gives you an extra margin of security (explained in the section on security). However, it's not absolutely necessary, so don't worry if you already have your database file names and relationships all set up.
The following few pages go through the precise process of writing an HTML page inside a FileMaker Pro calculation field. We will take a look at the required "html" calculation field, and the optional "detail" calculation field. Keep in mind that only the "html" calculation field is required for the purpose of returning a found set of records. Most of your dynamic web pages that return a single record of information will be Template files as discussed in Chapter 7: Page Generation.
NOTE Steps 8 and 9 below are optional. They are presented here only as an example of a complex detail calculation. To return a "detail" field, the "html" calculation formula shown above should be modified, replacing "html=detail.html" with "html=detail".
Fortunately, there are other options for including quotation marks in a
calculation formula. The easiest is to use a single quote mark anywhere a quote
mark in a text string is needed. The HTML specification allows for either single
or double quotes surrounding a URL location or entity attribute. This does not
apply to what's known as"smart" or "curly quotes", so go into your FileMaker Pro
document preferences and turn "curly quotes"off.
However, this recommendation may not apply to the "html" field containing only a small amount of information that is typically returned in a "hit list". Certainly, indexing of HTML calculation fields can and should always be turned off.
Use "Define FieldsÉ" in FileMaker Pro and add new fields to the target database of type Global with the name "header" and "footer". In Browse mode paste the HTML for a custom header into this "header" field and custom footer HTML into the database "footer" field. Now, whenever a database query occurs with the Find or FindAll commands, the custom HTML in these two fields will be returned to the web browser as portions of the HTML document. The "header" and "footer" HTML can be returned when other commands are used, but in such a case it must be explicitly specified in a FORM or a Link by using the INPUT variables "header" and "footer".
Example:
<INPUT TYPE=hidden NAME=header VALUE=header>
<INPUT TYPE=hidden NAME=footer VALUE=footer>
Use "Define FieldsÉ" in FileMaker Pro and add a new field to the target database of type Global with the name "error". In Browse mode paste the HTML for a custom error message into this database "error" field. Now, when a Find results in no records found, the HTML in the "error" field will be returned to the web browser by default.