|
|
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Disadvantages of Online Surveys |
This tutorial discusses three common methods of data collection:
These actions take place upon the respondent clicking the Submit button. The first two methods involve the use of a CGI script. When the Submit button is clicked, a script is called determining what happens to the data gathered from the form. For information on CGIs, look at TeamWeb's CGI Scripts page.
Basic ColdFusion Commands or TagsA ColdFusion application is a collection of HTML tags and special ColdFusion tags (they all begin with CF) that instruct the ColdFusion server to perform specific operations. ColdFusion tags, variables and functions are used with HTML to create dynamic, data-driven Web pages. <CFINSERT> adds a single row to a database. This tag requires that the database and table name be included. For example, <cfinsert datasource="ODBC Data Source" tablename="table name">.
While <CFINSERT> is easy to use, it also removes all control over how you handle your queries. It is preferable to use a <CFQUERY> tag with SQL commands as found in Putting It All Together. Look here for an example of a complete script. <CFQUERY>, </CFQUERY> queries a database for specific information. The use of the 'name' attribute is strongly suggested. The results of the query will be called "name". For example, <cfquery name="x" datasource="ODBC Data Source"> .....</cfquery>.
(See Putting It All Together for an example of a complete script.) <CFOUTPUT>, </CFOUTPUT> displays the results from
from the query. If <cfquery> is used, any code between <cfoutput> and </cfoutput> is
repeated once for every row in the database. For example, <cfoutput>Employee <b>#name#</b> added. </cfoutput>.
(See Putting It All Together for an example of a complete script.) Security and ColdFusionTo make your database more secure, set a database password in Microsoft Access. To do this, after receiving your datasource name, go into Microsoft Access, choose Tools/Security/Set Database Password and set a password for the database. By default, the username will be 'Admin'. Then, using an application.cfm script, you can set the username and password as Cold Fusion application variables. (See #1 below.) Store this file in the directory where your Cold Fusion scripts are and use application.cfm everytime you do a <cfquery>. (See #2 below.)
In the ColdFusion environment, every time a script executes, the first thing that happens is the ColdFusion engine searches the page's directory for a file called application.cfm. If found, it gets processed ahead of the script. If not found, ColdFusion searches up the directory tree and will use the first application.cfm page it finds. The ColdFusion engine will never let the outside world see the contents of that file. Most of the attributes in the application file are optional and are used for ColdFusion client and session management. Basic content of an application.cfm file are the scope variables client, session, and cookie and how long they are active.
(For assistance with using CGI or ColdFusion scripts, contact TeamWeb's consulting desk. For assistance with creating a Windows account, ColdFusion Registration and DSN requests, call 475-9400 to make an appointment with the Windows Services Group. |
|||||||||||||||||||||||||||||||||||||||||||||||
|
Last updated January 29, 2008.
To submit questions or comments regarding this page, use the online Comment Form.
|
||||||||||||||||||||||||||||||||||||||||||||||||