Formatting escapes: Introduction

Formatting escapes are sequences of characters beginning with % that can be used in dbCGI files to place some value in the HTML, in the contents of a directive, and inside other formatting escapes.

Because the % character is used to introduce a formatting escape, you must use the %% formatting escape to represent the % character anywhere you want a literal % character.

Form variables received via the POST method with a content type of application/x-www-form-urlencoded (the default) are automatically decoded. If the content type of form data received via the POST method is multipart/form-data, use the decode-mpf subcommand to decode them. Variables received by the GET method are not decoded at all, so you must use the POST method for forms.

Query string values (values after the first ? in the URL) are automatically split up at any + character and treated as arguments.

These arguments and variables can be substituted in the HTML, or in commands issued to the database. Further, the results of queries issued to the database can be formatted into HTML.

The formatting escapes provide a powerful mechanism for presenting the output of queries in any way desired, and for providing forms which can update the database.