A database refers to data organized and stored on a computer that can
be searched and retrieved by a computer program. Most industrial-strength
and many smaller database applications can be addressed using SQL (Structured
Query Language).
A session is a way to preserve certain data across subsequent accesses
of the same web application. The session object contains many variables
to store user information on the web server in a location that you choose
in special files. The session support allows you to register arbitrary
numbers of variables to be preserved across requests. Sessions are specific
to individual users. As a result, every user has a separate session and
has access to a separate set of Session variables.
Create custom transactions in multiple steps
In order to gradually build an insert page containing specific fields,
which you can manually define, you can use the form tools and the Server Behaviors panel. This procedure requires
the adding of an HTML form that would allow
users to enter data, and a Custom Transaction
to insert records in a database
table. The submitted information in the form can be saved in the database
(by calling a stored procedure) or not. In the latter case, it could simply
be sent as an e-mail to where it is needed to be known.
The form objects will be laid out in a basic table, which you can customize
by using the Dreamweaver page design tools
(make sure all the form objects remain within the form’s boundaries).
To edit the server behavior, open the Server Behaviors
tab of the Application panel (Window
-> Server Behaviors) and double-click
the Custom Transaction server behavior.
Dreamweaver adds a server behavior to
the page that allows users to insert records in a database table or send
the new information via e-mail by clicking the Submit
button on the form.
The Basic tab
The first step into completing the dialog box requires the user to input
basic information about the transaction, like the database connection
and the page to which it will be redirected:
To set the dialog box options, follow the next steps:
In the Connection drop-down
menu select the database connection defined for your site; if you don't
have a connection yet, you can use the Define
button and create one now.
In the First check variable
drop-down menu select which element should act as a starter condition
for the insert operation (either URL Parameter, Form Variable, Cookie,
Session
Variable, Server Variable, Entered Value), and type its name in the associated
text-box.
In the When finished, go to
text box enter the page to be opened after the record is inserted into
the table or click the Browse button to
select the file page.
The three buttons in the top right corner of the
interface offer you the next functionalities:
· Click OK when you are done configuring the server behavior.
· Click Cancel to exit without the new settings to be
applied.
· The Help button takes you to this help page.
These buttons appear on all three interfaces of the Custom
Transaction server behavior.
Click on the Fields
tab to continue with configuring the server behavior.
The Fields tab
This dialog box allows you to add fields in your form. You can associate
database fields with form controls:
To set the dialog box options, follow the next steps:
In the Fields area specify
the form objects you want to include on the HTML
form of the insert page. You have to add the fields manually, using
the Plus (+)
button. The Minus (-)
button is used to remove fields from the form.
You can change the order of the form objects on the HTML
form by selecting a form object in the list and clicking the up
and down arrows on the right top side of the dialog box.
Specify the required settings for each
data-entry in the HTML form by selecting
a row (single click) in the Fields area and
entering the required information in the boxes below the grid, as indicated
below.
In the Submit as drop-down
menu select the data format accepted by your database table, or the one
compatible with the further usage of this field content. For example,
if the table column only accepts numeric data, select Numeric. All the
options that you have are listed below: Text, Numeric, Double, Date, Check
box: Y,N,
Check box: 1,0, Check box:-1,0, File.
In the Get value from
drop-down menu select the source from where the value is retrieved: URL
Parameter, Form Variable, Cookie, Session Variable, Server Variable, Entered
Value, Form in page, File field.
If the Variable name
text box is displayed (it depends on the Get value
from selection), enter the name for the variable. If the Value text box is displayed, enter a value, and
if the Form field drop-down menu shows, select
the suitable option.
In the Default value
text box, when enabled, enter the default value for the currently selected
form field.
Click on the Advanced
tab to continue with configuring the server behavior.
The Advanced tab
This last step in configuring the server behavior requires the user
to set some transaction options:
To set the dialog box options, follow the next steps:
In the Transaction name
text box enter the desired name for the custom transaction. Be careful
when choosing it, because it has to be unique on each page. By default,
MX Kollection 3 assigns unique names to
each transaction, and this setting should not be changed, unless you really
know what you are doing.
In the SQL query editable
area you can write an SQL query for the current transaction (only if there
is an active SQL connection). When putting together the query and choosing
fields from the current ones, you can use the InterAKT
Dynamic Data (the lighting bolt icon).
After completing the user interface, click on the
OK button to apply the server behavior,
or Cancel to dismiss it without making any
changes to your page.