Indiana University Northwest

Web Services

red line

Transform Instructions

Transform 3.0 was developed to make it easy for IU Information Providers to create working www forms without having to learn cgi programming. It is used on the Webserve, professional server (www.iun.edu accounts). Transform is a generic utility for processing html forms. Using Transform, you can have the values submitted via a form emailed to you or appended to a data file. Transform gives you control over the format of the information returned to you as well as the response you return to users.

IU Northwest Webmaster Form Creation Example

Please note the form file name is sample.shtml. All associated files must be named the same name with different extensions.

If you form contains sensitive information, like social security numbers, be sure to create the form as a secured web page in a folder on the the wwws area on Webserve.

  • First make a Sample form - calling it sample.shtml
  • Make .tpl processing file - calling it sample.tpl
    • Copy field names to .tpl to prevent typos
    • Examples of .tpl forms
      • see sample.tpl for a working sample - it is used to process this form (also see sample-code-only.tpl for an example with less instructions)
      • see sample-instruction.tpl for information for each section
        • If you only need a form processed and e-mail use the sample.tp
        • To make a Sample Success Response page- call it sample-success.shtml if you want to show a web page when they successfully complete your form. Copy this htm code to the *success-response* area of the .tpl file.
  • Use SSH2 Client to telnet to your web account.
  • You must install Transform in your Web account first! Login to your web account and change to the directory where you will store your forms (i.e., /forms).
    • Type tf_install at the prompt to install Transform. You should install Transform in every directory where you keep forms.
      • You will recieve the following message " Transform was successfully installed as transform.cgi in the directory "
      • Next, go to the New File Transfer Window to change the properities of the transform.cgi file so that you don't accidentally erase the file when putting files on the web

Image of SSH window

      • Then navigate to the folder with transform.cgi
      • Right click on transform.cgi and select properties and change the properties to 500.

Transform CGI rights of 500

    • Exit the SSH2 Client.

After ftping the form and .tpl file to the web, test your form. It should work.

If for some reason, your form doesn't work, check to make sure that the transform.cgi file has execute rights. If is doesn't do the following:

  • Use SSH2 Client to telnet to your web account.
  • Enter the following command: cd folder - folder in which the transform.cgi resides.
  • Enter the following command to add execute access rights: chmod u+x transform.cgi - this will allow the form now to execute the transform.cgi script.
  • Exit the SSH2 Client.

If the above doesn't work do the following:

  • Use SSH2 Client to telnet to your web account.
  • Enter the following command: cd folder - folder in which the transform.cgi resides.
  • Enter the following command: rm transform.cgi - this will delete the file.
  • Type tf_install at the prompt to install Transform again.
  • Exit the SSH2 Client.

Minimal information needed in a form to process the form to e-mail. *define-variables*, and *email-response*.

Excel or Access files

  • As you are making a sample form, open another window and create the processing file ( .tpl file) for that form.
    • If you are using using Dreamweaver, open a new form
    • The name of all associated files for this form must be named the same as the form. To process the above sample.shtml form, there must be a sample.tpl file.
  • If you want a nice reply the make a Sample reply that you will use to copy code into the sample .tpl file - call it the same name as your form, but put -reply after the name so you know it is the form you made to paste code into the reply area.

Use !print-if statements to control which sections are processed

See the Tools for processing form above to

IU Webmaster Tools for Forms

Areas you might want to use

Allowed comparison operators
  • eq - equal string comparison
  • ne - not equal string comparison
  • == - equal numeric comparison
  • != - not equal numeric comparison
  • > - numeric greater than
  • < - numeric less than
  • <= - numeric less than or equal
  • >= - numeric greater than or equal
  • =~ - Perl regular expression matches
  • !~ - Perl regular expression doesn't match
  • example of !print-if in the *e-mail response* section where the [fieldname] is not a required field and will only print in the e-mail if it has been completed
[phone] only prints if completed
!print-if [phone] ne""
Phone: [phone]
!end-print-if
  • example of !print-if in the *e-mail response* section where the [fieldname] is not a required field and will print the fieldname with no information but puts in a blank line so the next field will not print right next to the blank field
code example with no !print-if
Comments: [comments]
Recess: [recess]
example e-mail
Comments: Recess:

fields comments and recess run together in the e-mail

code for month day, year
[!MOY] [!DD], [!YYYY]
code for date and time
[!DATE]

 

 


[phone] only prints if completed
Comments: [comments]
!print-if [comments] eq ""
!end-print-if
Recess: [recess]
example e-mail

Comments:
Recess:

fields comments and recess are on separate lines in the e-maill - making the e-mail more readable.

 

Environmental Variables:

Environment variables must begin with an exclamation point (e.g. !) within a page, i.e. [!DATE]

 

SSI Environment Variables - use <!--#echo var="Variable" -->

  • DOCUMENT_NAME: The current filename.
  • DOCUMENT_URI: The virtual path to this document (such as /docs/tutorials/foo.shtml).
  • DATE_LOCAL: The current date, local time zone.
  • DATE_GMT: Same as DATE_LOCAL but in Greenwich mean time.
  • LAST_MODIFIED: The last modification date of the current document.
  • HTTP_USER_AGENT: The visitor's browser software
  • HTTP_REFERER: The page from which the visitor came
  • SERVER_SOFTWARE: The version of the web server
  • SERVER_NAME: Your server name
  • REMOTE_ADDR: The remote IP address of the the visitor
  • REDIRECT_URL: Page person wanted

<!--#echo var="SCRIPT_URI" --> shows all variables available