Web Tools -- Database Tool
The database tool allows you to create web forms that save the results in tab delimited
files. These files can later be downloaded and easily read into a database
or spreadsheet program. It allows you to easily set up the web forms without
having to write and maintain CGI scripts.
The database tool script is currently located at http://webtools.ucdavis.edu/cgi-bin/dbtool.pl (This location may change in the future).
However, you should not link to this url directly. You need to use the action
option of the <form> HTML tag to use it. You also need to set hidden options
in the form.
The available options are:
-
account - Your UCDLoginID. This is a required field. In order
to access the data you will have to logon with this account so it's important
that it's correct. You can list multiple UCDLoginIDs seperated by commas if
you want the data to go to multiple accounts.
-
filename - The name of the file where the data is stored. This is a
required field.
-
redirect - After the form is submitted, the user will be sent to this webpage.
This is also optional.
-
limit and limit_url - Checks the number of entries and
redirects user to limit_url if over limit entries already received. This
can be used to inform users they are on a waiting list or other such
applications. These are optional.
You need to create a WWW form using your favorite HTML editor, include the
Javascript code from http://webtools.ucdavis.edu/dbtool/dbtool_verify.js,
create a form
with the action http://webtools.ucdavis.edu/cgi-bin/dbtool.pl and the
onSubmit dbtool_verify(this), and add
hidden inputs for the options. Below is a simple example of a form using the
dbtool. You can copy this to your web server, change the account and filename, change the redirect to one of your pages, and try it out.
You can download the data from the
Database Tool Admin Page
Sample webpage HTML code
<HTML>
<SCRIPT SRC="http://webtools.ucdavis.edu/dbtool/dbtool_verify.js">
</SCRIPT>
<FORM METHOD="POST" ACTION="http://webtools.ucdavis.edu/cgi-bin/dbtool.pl" onSubmit="dbtool_verify(this)">
<INPUT SIZE=25 NAME="01name" TYPE=text>
<INPUT SIZE=25 NAME="02email">
User type:
<select name="05type">
<option>Student
<option>Faculty
<option>Staff
</select>
<input type=hidden name="account" value="ccctim">
<input type=hidden name="filename" value="test">
<input type=hidden name="redirect" value="http://webtools.ucdavis.edu/webtools/dbtool/">
<input type=submit value="Send Survey">
<input type=reset value="Reset Form">
</form>
</html>
Notes:
- The input fields are sent back in alphabetical order. If you want the
fields sent back in a specific order you can add numbers in front of the
field name. The numbers will be striped off by the database tool, but will
force the order you want.
- This tool is reserved for UCD affiliates. Therefore, it will only accept
input from webpages in the ucdavis.edu domain.
- Be sure you add the SCRIPT line and the onSubmit in the FORM tag. These
items are necessary to make radio buttons, checkboxes, and select lists work
correctly.
Back to Web Tools
Comments: tcleamy@ucdavis.edu
URL: http://webtools.ucdavis.edu/webtools/dbtool/
Last updated:Tue, 20-Mar-2007
|
 |