Information Technology Services Header

Web Office

The following form will insert information into an Oracle database.  You must have space on Oracle as well as tables set up before you can use this function of FormServlet.  Please contact the Web Office for more information on setting up your database.

 

Student ID (required)

 

Student Name

 

Exam Score

 

 
 

HTML:

 

<HTML>
< BODY BGCOLOR="#FFFFFF">
<B>INSERT TO A DATABASE:</B>
< FORM method="post" action="http://www.umsl.edu/servlet/FormServlet">
< input type="hidden" name="USER" value="example">
< input type="hidden" name="SQLFile" value="insert.sql">
< input type="hidden" name="Conditional" value="http://www.umsl.edu/computing/FormServlet/examples/oops.html">
< input type="hidden" name="URLreturn" value="http://www.umsl.edu/computing/FormServlet/examples/thanks.html">
< input type="text" name="REQId" size="30"> Student ID (required)<BR>
< input type="text" name="Name" size="30"> Student Name<BR>
< input type="text" name="Score" size="30"> Exam Score<BR>
< input type="submit" value="insert">
< input type="reset" value="reset">
< /FORM>
< /FONT>
< /BODY>
< /HTML>

 

FILES REQUIRED:
form5.html
user_data.example
insert.sql
oops.html
thanks.html

 

EXPLANATION OF TAGS:

<HTML>

    Basic HTML tag.  Tells the browser that the tags are using HTML.

<BODY BGCOLOR="#FFFFFF">

    Basic HTML tag.  Starts the BODY of the page.  Formats background color to WHITE.

<FONT FACE="Verdana, Tahoma, Helvetica, Arial" SIZE="-1">

    Changes the FONT on the page to be one of these. 

<FONT COLOR="#CC0000"><B>INSERT TO A DATABASE:</B></FONT>

    Changes the font color to UMSL red, and makes the "INSERT TO A DATABASE:" bold.

<FORM METHOD="post" ACTION="http://www.umsl.edu/servlet/FormServlet">

    Required element for UMSL forms.  Tells form to use FormServlet to process form information.

<input type="hidden" name="USER" value="example">

    This tag tells FormServlet which user is accessing the database.  The value of the USER tag points to a file hidden on the server with the database information: which database, login, password.  This file also contains the path to the SQL files for this user.  You must contact someone in the Web Office to have this USER profile set up according to your database space.  See the link above in the FILES REQUIRED section for an example of this file.

<input type="hidden" name="SQLFile" value="insert.sql">

    The USER tag specifies where your SQL statements are filed, but this tag specifies which SQL statement to use.  The SQL file is simply a text file with your SQL statement.  See the link above in the FILES REQUIRED section for an example of this file.

<input type="hidden" name="Conditional" value="http://www.umsl.edu/computing/FormServlet/examples/oops.html">

    This tag specifies the HTML file to return if required fields are not completed by the user filling out the form.  This tag is optional; if you leave it out, your users will have a default message returned.  The value of this tag can be any page you wish to use.  Please remember that this file is ONLY shown when a user does NOT fill in a required value on your form.

<input type="hidden" name="URLreturn" value="http://www.umsl.edu/computing/FormServlet/examples/thanks.html">

    This tag specifies the HTML file to return when the form is completed successfully.  This tag is optional; if you leave it out, your users will see a default message.  The value of this tag can be any page you wish to use.

<input type="text" name="REQId" size="30"> Student ID (required)<BR>

    This tag create the "Student ID" blank on the form.  Please note that this field is a REQUIRED field.  A field is specified as REQUIRED when the name of the field starts with REQ.  This field must be filled in when the form is submitted.  It will NOT submit if this field is left blank.

<input type="text" name="Name" size="30"> Student Name<BR>

< input type="text" name="Score" size="30"> Exam Score<BR>

    These tags create the blank spaces on the form.  Please note that these tags are NOT required, and do NOT need to be completed for the form to submit.

<INPUT TYPE="submit" VALUE="insert">

    This tag creates the SUBMIT button.  Clicking this button will send the form values to FormServlet, and return the message "Form Successfully Submitted" to the user.  Whatever text is used as the VALUE will be what appears on the button.

<INPUT TYPE="reset" VALUE="reset">

    This tag creates the RESET button.  Clicking this button will clear all answers from the form.  Whatever text is used as the VALUE will be what appears on the button.

</FORM>

    This tag tells the browser that the form is done, and needs to be placed at the END of your form.  No form variables AFTER this tag will work.

</BODY>

    Basic HTML tag.  This tag tells the browser that the BODY section of the page is closed.

</HTML>

    Basic HTML tag.  Tells the browser that the HTML is finished.