Replace?db=DatabaseName&searchdata=xx&field1=xx&field2=xx

Replaces each found record in a database with the new field values.

To replace records in a database, use a web browser to link to a URL containing the Replace command (alternately, you may embed a [Replace] context into a template). Whenever WebCatalog receives a Replace command, it immediately searches for the specified records in the database, and replaces those records' fields with the named field values.

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

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

Try It!

The database "SomeDatabase.db" is opened, all records whose name field is "Grant" are found, and fieldname "name" is set to "John", fieldname "address" is set to "1492 Somewhere Lane", and fieldname "zip" is set to "90000".

Any fieldnames that do not exist in the database are ignored, and any fields you do not specify are left unchanged. 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: You may force the visitor to enter something into a field by using the RequiredFields parameter in the URL. Setting RequiredFields=field1+field2+field3 will display 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 equivalent ways to send the same command:
HTML Source Description
<a href="/WebCatalog/WebCatalog.acgi
?command=Replace&template=xx.tpl&db=SomeDatabase.db
&name=Grant&address=1234%20Somewhere">
Hyperlink to WebCatalog CGI
<a href="xx.tpl?command=Replace&db=SomeDatabase.db&name=John&
address=1234%20Somewhere&eqNAMEdata=Grant">
Hyperlink to WebCatalog plugin
<form method="POST" action="/WebCatalog/WebCatalog.acgi">
<input type="hidden" name="command" value="Replace">
<input type="hidden" name="template" value="xx.tpl">
<input type="hidden" name="db" value="SomeDatabase.db">
<input name="eqNAMEdata" value="John">
<input name="name">
<input name="address">
<input type="submit">
</form>
Form-based command to CGI
(notice you must specify a template)
<form method="POST" action="xx.tpl">
<input type="hidden" name="command" value="Replace">
<input type="hidden" name="template" value="xx.tpl">
<input type="hidden" name="db" value="SomeDatabase.db">
<input name="eqNAMEdata" value="John">
<input name="name">
<input name="address">
<input type="submit">
</form>
Form-based command to plugin
(notice the template is part of the action)

Parameters for Replace:
Parameter Description

Append

(Optional) "T" if you want a new record to be added to the end of the database in the case where no records were found to be replaced.