Go to USC home page USC Logo UNIVERSITY TECHNOLOGY SERVICES
UNIVERSITY OF SOUTH CAROLINA
DIVISION OF IT | OFFICE OF IT | GET CONNECTED | UTS HOME
UTS MAIN MENU

POPULAR LINKS

DEPARTMENTS

SERVICES & SUPPORT

NEWS & INFORMATION

A-Z INDEX
 
UTS GENERAL INFORMATION

HELP DESK HOURS:
Monday - Friday
8:00am – 9:00pm
(803) 777-1800

WALK-IN HOURS:
Monday - Friday
8:00am – 5:00pm
1244 Blossom Street
(Corner of Blossom/Sumter St., Columbia campus)

FAX:
803-777-1900

EMAIL:
UTS@sc.edu
USC   THIS SITE
 

Feedback System

What is the feedback system?

This document contains information supporting the feedback system offered on this server. Please note that a site is not required to be hosted on the main web server in order to use the feedback system, but the files associated with the feedback system must reside on the main web server.

Features

The feedback system has the following functions:

  • The system supports response forms from simple web page feedback to online surveys.
  • The author determines the appearance of the input form, the email response, and the response page users see after they click submit.
  • The author may select to have the user's input sent as email to a particular address.

How does it work?

The CGI will respond only to referring pages on www.sc.edu, so the feedback system requires an account on the main web server. There are several files required to use the feedback system. All files must be housed on the www.sc.edu.

  1. The input form file: this is an HTML file containing the form you wish your users to complete and submit. [view the template]
  2. The email format file: this is a file that configures the way your email response appears. [view the template]
  3. The return page format file: this is an HTML file that configures the appearance of the response page your users see. [view the template]

How do I create an Input Form?

The feedback CGI is accessed by creating an HTML form with the beginning FORM tag <FORM ACTION="http://www.sc.edu/cgi-bin/feedback/feedback.cgi" METHOD="post">. This file must reside in your directory and have the standard HTML file extension .html or .htm.

Hidden Variables

There are several hidden form variables that you need to declare in order to have the feedback CGI work properly. These variables are defined using <INPUT TYPE="hidden" NAME="variable name" VALUE="variable value">. The values are as follows:

return.html
Defines the return page in HTML that the user will receive upon completing and submitting the form. Uses the <FILLIN> tag described below.
email.to
Defines the email address to which the email results of the form are sent.
email.from
Defines the email address from which the email results of the form are sent.
email.subject
Defines the email subject line.
email.format
Defines the format file of the email message. Uses the <variable_name> format described below.

File Locations

The location of return.html and email.format are defined as follows:

  1. Any value containing ".." is rejected.
  2. If the value starts with "~username" or "/~username" then /export/home/username/public_html/[remainder of value] is used to access the file.
  3. If the value starts with "/", then /usr/local/ns-home/docs/value is used to access the file.
  4. Otherwise (value does not start with "/" or "~"), then the form's URL (referrer) is stripped off the hostname and any trailing .html files, and then is subjected to the rules above.

How do I create a Return Page Format file?

The Return Page Format file is an HTML template the CGI uses to form the return page users see after they click "SUBMIT". This file must reside in your directory and have the standard HTML file extension .html or .htm. The return page uses some special tagsets described below.

FILLIN Tag

The <FILLIN> tag is used to put form values into the page returned to the users. The tag has the format <FILLIN NAME="Variable_Name" WIDTH="width" PREFIX="prefix" SUFFIX="suffix">. Attribute Definitions:

NAME
The CGI variable name from the feedback form
WIDTH [Optional]
The fixed width when printing the value; it will always print to this width. This is useful for lining things up with the <PRE> tagset.
PREFIX [Optional]
Prints this value before the CGI variable value only if the variable is not blank.
SUFFIX [Optional]
Prints this value after the CGI variable value only if the variable is not blank.

SFILLIN Tag

The <SFILLIN> tag is used to put form values from a select tag, where you want the user to see the wording of a select statement rather than a code. For example, if you had the following in your input form:

<SELECT NAME="usertype">
<OPTION VALUE="N">New User
<OPTION VALUE="O">Old User
</SELECT>

In your return page, if you used the <FILLIN NAME="usertype"> tag you would have either "N" or "O" printed. To avoid this you can use the following in the return page:

<SFILLIN NAME="usertype">
<OPTION VALUE="N">New User
<OPTION VALUE="O">Old User
</SFILLIN>

This will print the either "New User" or "Old User" depending on the value of usertype.

COND Tag

The <COND> tag provides you a way to make conditional decisions in your return page. The tag has the format
<COND NAME="variable_name" VALUE="value" [NOT]>
<!-- HTML code-->
</COND>
Attribute Definitions:

NAME
The CGI variable name from the input form
VALUE
The value to test with NAME
NOT [Optional]
If NOT is specified NAME and VALUE are tested for inequality. If NAME is equal (not equal if NOT is present) to VALUE, then the data before the </COND> is printed/processed. Otherwise all data between the initial <COND> and the </COND> is ignored.

The COND tags can be nested so that you can have conditionals within conditionals.

DATE Tag

The DATE tag allows you to specify the current date and time in the return page. The format is <DATE FORMAT="format"> Attribute Definitions:

FORMAT [Optional]
The format you want your date to be in. The default is %c (Tue Mar 23 15:04:04 1999). Other codes include:
  • %A, %d %B %Y Day Date Month Year (Tuesday, 23 March 1999)
  • %a abbreviated weekday name (Tue)
  • %A full weekday name (Tuesday)
  • %b abbreviated month name (Mar)
  • %B full month name (March)
  • %c default date and time (Tue Mar 23 15:04:04 1999)
  • %d day of month (23)
  • %D date as %m/%d/%y (03/23/99)
  • %p equivalent of either a.m. or p.m. (PM)
  • %r appropriate time representation in 12-hour clock format with %p (03:13:08)
  • %x appropriate date representation (03/23/99)
  • %X appropriate time representation (15:13:08)
  • %y year excluding the century (99)
  • %Y year including the century (1999)

How do I create an Email Format File?

CGI Variables

For the email format file CGI variables are defined using the <variable_name> format.Whenever the feedback CGI encounters a string inclosed in < > it will replace it with the variable value if it exists, or a blank string if it does not.

Special Variables

There are currently four special variable names that are reserved for feedback CGI use:

<client_ip>
Replaced with the IP address of the client filling out the form.
<refer>
Replaced with the URL of the form that called feedback.cgi.
<date>
Replaced with the current date in mm/dd/yyyy format
<time>
Replaced with the current time in hh:mm:ss format

RETURN TO TOP
USC LINKS: DIRECTORY MAP EVENTS VIP
SITE INFORMATION