There are thirteen @ commands:
Each command, (except @@ and \) should be followed by an argument in delimiters. Although typically parenthesis are used as delimeters, there are actually six possible sets of delimeters. delimiters can not be nested, so if you need parenthesis to appear inside of delimiters, you must use a different set.
The six sets of delimiters are:
(), <>, [], {}, '', and ""
Example:
@field<last>, @field{first}
Desciption: provides lookup of special built-in values. Currently the only available values are date and time related.
Syntax: @BuiltIn(keyword)
where keyword is one of date, time, datetime,
version.
@BuiltIn(date) - current date in month/day/year format.
@BuiltIn(time) - current time in military hour:minute:second format.
@BuiltIn(datetime) - current date and time separated by a tab.
@BuiltIn(version) - The version of the formproc program processing this request.
Example:
Request was submitted on @Builtin(Date) at @builtin(time).
A simple form of if statement. Allows the value of a field to be matched against a list, and different actions to be taken depending on the result.
Syntax: @Case(key=fieldname, value1=substitutions, value2=substitution2,value3=substitution3, default=defaultsub, null=nullsub)
Example:
@case{key=[@field(credit)], yes=[@field(name), @field(location), @field(state), @field(country)], default=[NO CREDIT]}
In this example the field 'credit' is examined. If the field has the value 'yes' then the @case statement expands to "@field(name), @field(location), @field(state), @field(country)". If the 'credit' field has any other value, the @case statement expands to the text "NO CREDIT". The 'null' value allows you to check to see if a field is empty.
Description: allows coments to be placed in a template file. These comments are not passed thru to the output file.
Syntax: @Comment(text to be ignored)
Example:
@Comment[This template file was created by Michael Fryd on May 19, 1997]
Description: Looks up value of a Unix 'environment' variable. See the CGI documentation for a complete list of available environment variables.
Syntax: @Env(Environment-Variable-Name)
Example:
Request was submitted from @env(REMOTE_HOST) (@env(REMOTE_ADDR))
Here are some of the more usefule environment names:
HTTP_USER_AGENT: The browser being used (Mozilla/3.0 (Macintosh; I; PPC))
REMOTE_HOST: The DNS name of the user's machine (bubinga.dilido.totalweb.com)
REMOTE_ADDR: The IP address of the user's machine (199.227.109.134)
DATE_LOCAL: The date and time the server received the request (Monday, 19-May-97 21:49:08 EDT)
USER_NAME: For password protected pages, the username specified int he password dialog (mfryd)
Please remember that environment variable names are case sensitive.
Desciption: Includes the contents of a specified file. Any @ commands in the file are processed.
Syntax: @ExpandFile(filename)
Example:
@ExpandFile(information.mail)
Note: A file being expanded may contain additional @ExpandFile commands. There is a limit to how many levels deep you can nest these commands can be nested. Currently this limit is about 15 levels.
Files to be expanded should not contain lines longer than 1000 characters
Filenames starting with a leading '/' are relative to the document root for the web site containing the formproc control file. Filenames that do not start with a leading slash, are interperted relative to the directory containing the formproc control file. "Special" prefixes, such as /cgi-bin ~username, or /shared, are not preoperly handled.
Desciption: provides lookup for field values in the html form.
Syntax: @Field(keyword[, option=value])
where options is blank, or one or more of pad, default,
missing, softwrap, quotehtml, quoteallhtml,
or unchecked.
In the simple case of @field(fieldname), the @field command is replaced with the user entered contents of the corresponding field of the html form. The options allow you to specify that the value be padded to a certain width with spaces (useful for creating order forms) and what to do if the field is missing or empty.
The Pad=number option allows you to specify a field width for the text. This is very useful when creating e-mail invoices. The maximum allowed pad is 256.
softwrap="margin" requests that the field contents be broken across multiple lines, each no more than margin characters wide. Where possible, line breaks will be inserted between words. Margin must be less than or equal to 250. When Sofwrap is requested, formproc is free to remove trailing whitespace from lines.
xout="chars-to-save" causes the field to be echoed with all alpha numeric characters converted to 'X'. This is useful for echoing credit card numbers in confirmation screens. The argument is optional. If present, then not all of the characters will be converted. If a positive number is specified, than all but the first n characters are converted, if a negative number is spacifed, than all but the last n characters are converted to 'X'. For example, specifing an xout=-4 will cause "1234-5678 9012" to echo as "XXXX-XXXX 9012".
The QuoteHTML option cause the contents of the field to be converted to HTML. '<', '>', and '&' are converted to <, >, and &. This is very useful when creating html pages from form input. The interactions between QuoteHTML and xout or pad are not well defined. You may use QuoteHTML and Softwrap together, in which case the QuoteHTML is processed before the Softwrap.
QuoteAllHTML is like QuoteHTML except that '"' is also converted to ". If both QuoteHTML and QuoteAllHTML are specified, QuoteAllHTML is honored.
@field(numberordered, pad=10)Will be replaced with the contents of the 'numberordered' field. If the field has less than 10 characters, enough trailing spaces will be added to bring the character count to 10.
The default="value" field allows you to specify a value to be used in the event the user has left the field blank. For example:
Fax: @field(fax, default="not specified")
Missing and unchecked are synonyms. They allow you to specify a value to be used in the event the field does not appear on the form, or if a checkbox field is unchecked (we can not tell the difference between the two).
Rush Order: @Field(rushcheckbox, unchecked="")
You may use any combination of default, pad, softwrap, xout, and unchecked, in the same @field command.
Examples: If the html form has text fields named 'lastname', 'middlename', and checkboxes named 'rush' and 'wholesale"
Last name: @field(lastname)<br> Middle Initial: @field(middlename, default="<i>no middle initial</i>")<br> <pre> Rush Order: Wholesale @field(rush,unchecked="no", pad=30) @field(wholesale) comments: @field(comments, softwrap=60) </pre>
Note: Field names are case sensitive. You must match the case used in the html form. Our style guides ask that you only use lower case characters in your field names. Field names may consist only of letters and numbers.
Same as @ExpandFile, except that we do not attempt to process @ commands in the included file.
Example:
@includeFile(stdfooter.html)
Desciption: converts Line Feed characters to Vertical Tab characters in the argument. Any @ commands int he argument are processed before the conversion. Conversion of LF characters to VT characters is useful if multiline text is to be stored into a guest book files. The FileMaker Pro database (from Claris) expects VT characters to be used instead of LF's in tab delimited, or comma delimited text.
Syntax: @LFtoVT(text)
Example:
@field(name)@tab()@LFtoVT[@field(comments)]
Description: replaces with a space any character from the argument that might be a security risk if passed as a command line to a sub-shell. Any @ commands in the argument are processed.
The following characters are always converted to spaces: < > ( ) | & ` ' " \ ;
Additionally, any character outside the traditional 95 printing ASCII characters are converted to space.
The '-' and '+' characters are also replaced if they follow a space.
Example:
mail to "@makesafe(@field(salesmanemail))" content<@expandFile(confirming.mail)>
Desciption: quotes HTML commands in the argument. Any @ commands in the argument are processed before the conversion. This is useful for taking user supplied text and placing it in a html page.
"&" is converted to "&"
"<" is converted to "<"
">" is converted to ">"
A single new line is converted to "<br>newline". When consecutive newlines appear, the first two are converted to a "<p>" and subsequent newlines into "<br>".
.
Syntax: @QuoteHTML(text)
Example:
@includeFile(prefix.txt)
@QuoteHtml(@field<special>)
@includeFile(postfix.txt)
See also: @Field(..., QuoteHTML)
Desciption: Removes HTML Tags from the argument. Any @ commands in the argument are processed before the conversion. This is useful for taking text processed with @QuoteHTML and putting it as the default text in a field of an admin module form.
Any text between "<" and ">", including the "<" and ">" is deleted.
.
Syntax: @StripTags(text)
Example:
<TextArea name="specials" Rows=12 Cols=60
Wrap=Virtual>@StripTags(@Field[specials])</TextArea>
Description: Places a tab character into the output file.
Syntax: @Tab()
Example:
@field(name)@tab()@field(age)@tab()@builtin(datetime)
Description: places a single '@' character into the output.
Syntax: @@
Example
For more information send mail to mfryd@@totalweb.com
Descritpion: Makes it easy to type some hard-to-type characters.
Syntax: \x
Where x is t, n, k, r,
f or \
(characters must be lower case)
\t is replaced by a tab character
\n is replaced by a newline (line feed) character
\k is replaced by a vertical tab character
\r is replaced by a Carriage Return character
\f is replaced by a formfeed character
\\ is replaced by a single \ character