Link to Home page Link to Contact Information Link to Links Link to Fun stuff My Resume My Ph.D. work My Web Sites Technology Related Material Pedagogy Related Material

8 Steps to Making Forms Work on the Bama Server (and actually getting the data)

 

Step #1:

Make your HTML form. See Example

   

Step #2:

Name every form field that you will want to have the data from.

  • This is necessary to call which field will later be written to a text field or emailed to you.  Most fields will be self-naming, but some will require more thought.
  • Use lowercase, no spaces in the names
  • Radio Buttons and Check Boxes:  Name all your radio buttons with the same name, but make sure the value is different for each one.

For Example:

Would be coded like this:

Sex: <input type="radio" name="sex" value="male"> Male&nbsp; <input type="radio" name="sex" value="female"> Female

 

 

 

 

 

 

Step #3:

Add the correct action into your <form> tag:

  • to have the data emailed only:
    <FORM ACTION="/cgi-bin/FormMail" METHOD=POST>
  • to have the data written to a text file on the server (later to be downloaded and then put in your own spreadsheet or database):
    <FORM ACTION="/cgi-bin/BFormMail" METHOD=POST>

 

Step #4:

Add the required hidden fields:

  • Appends field values to a flat-file database (text file), where file_path=the absolute or relative URL of your text file.
    <input type=hidden name="append_db" value="file_path_and_name.txt">
  • Specify exactly which fields are appended to the database
    <input type=hidden name="db_fields" value = "realname,email,homephone">
  • The separator character between fields in the database --I strongly suggest you use a semicolon or tab--if you use a comma, you will regret it later!
    <input type=hidden name="db_delimiter" value = ";">

Step #5:

Add any additional hidden field.

Here are some examples.

Step #6:

Create a blank text file and ftp it to the server.

Make sure the name of the file matches the name of the text file you put in the "append_db" hidden field.

Step #7:

Set the correct permissions for the text file.

  • This is the hardest part.
  • Simply put, in order to be able to write to a text file, the server has to have permission. You have to give it permission.
  • After you have ftped the file to the server, go into WS_FTP (or whatever program you are using), and click on the name of the text file you have ftped up to the server.


    instrucitons

  • Right mouse click and scroll down to chmod (Unix)


    directions

  • Set the permission to 662 (rwx, rwx, w) or, like this:


    directions

  • Now, go back up to the sub-directory that houses the file


    directions


  • Set the permission on the subdirectory to 773 (rwx, rwx, wx), or like this:


    directions

Step #8:

FTP all your files up to the server and TEST, TEST, TEST

For more information, try the ReadME file.

 

Copyright © 2002 by Susan Lucas and the Faculty Resource Center. All Rights Reserved
No part of this work may be reproduced without the consent of the author.
You may quote or link to this site if you follow standard APA or MLA citation procedures.
  Email: susan@frc.ua.edu