Append?db=DatabaseName&field1=xx&field2=xx

Appends a new record with the specified field values to the end of a database.

To add new records to a database, use a web browser to link to a URL containing the Append command (alternately, you may embed an [Append] context into a template). Whenever WebDNA receives an Append command, it immediately adds a new record to the end of the specified database given the named field values.

SQL/ODBC Note: To append new records to the end of an ODBC-compliant table, use the [SQL] context.

Example (normally you would link to a URL or form containing the following information):

http://yourserver.com/xx.tpl?command=Append&db=SomeDatabase.db&name=Grant&address=1492%20Somewhere%20Lane&zip=90000

The database "SomeDatabase.db" opens, and a new record is added to the end. The field name "name" is set to "Grant," the field name "address" is set to "1492 Somewhere Lane," and the field name "zip" is set to "90000." The page sent back to the browser will be xx.tpl.

Any field names not existing in the database are ignored, and any fields you do not specify are left blank in the new record. Certain letters are illegal, such as <tab> or <carriage return>, so they are converted to <space> and <soft return> before being added to the database. Some computers use the two-character sequence <carriage return><line feed> to indicate a single end of line, which is automatically converted to a single <soft return> character before being added to the database.

You may specify a relative or full URL to the database file, as in "/WebCatalog/Folder/SomeDatabase.db" or "../SomeDatabase.db." The path to the database is always relative to the template URL, so if the database is in the same folder as the template the path would be "SomeDatabase.db", and if the database were one folder up then the path would be "../SomeDatabase.db."

Note: normally all database file paths are relative to the local template, or if they begin with "/" they are relative to the web server's virtual host root. As of version 3.0, you may optionally put "^" in front of the file path to indicate the file can be found in a global root folder called "Globals" inside the WebCatalog folder. This global root folder is the same regardless of the virtual host.

Note: You may force the visitor to enter something into a field by using the RequiredFields parameter in the URL. Setting RequiredFields=field1+field2+field3 displays an error message if the visitor forgets to enter some text into any of those 3 fields. RequiredFields works for all commands, not just this one.

Here are some other ways to send the same command:

HTML Source

Description
<a href="xx.tpl?command=Append&db=SomeDatabase.db&name=Grant&address=1234%20Somewhere">
Hyperlink command
<form method="POST" action="xx.tpl">
<input type="hidden" name="command" value="Append">
<input type="hidden" name="db" value="SomeDatabase.db">
<input name="name">
<input name="address">
<input type="submit">
</form>
Form-based command