Getting Visitor Feedback, Part 2: Appending Form Data to a File

A relatively easy way for EarthLink members to handle the responses they receive from their online forms is to "append" the data to a file. This way, the data can be downloaded later at their convenience. Here's how to do it:

  1. Data Directory. A subdirectory within your webdocs directory must be "world-writeable." Most domain directories are set up in this way when they are created. If you have a directory called data within your webdocs directory then you're all set. If you do not, email webmaster@earthlink.net and request that this be done.

  2. Create the form that you need. For help, consult the tutorials in the forms section of the Web Site Workshop.

  3. Form METHOD and ACTION. The <METHOD< of the <FORM> tag should be set to "POST". The <ACTION> of the <FORM> tag should be set to one of two EarthLink URLs: http://home.earthlink.net/cgi-bin/appendto if you are using your free 6MB webspace, or http://www.earthlink.net/cgi-bin/appendto if you have a unique domain name Web site.

    <FORM METHOD="POST" ACTION="http://home.earthlink.net/cgi-bin/appendto">

    <FORM METHOD="POST" ACTION="http://www.earthlink.net/cgi-bin/appendto">

  4. Use Hidden Input Type. Somewhere in your script between the <FORM> and </FORM> tags, you must include the following hidden <INPUT> tag:

    <INPUT TYPE="HIDDEN" NAME="appendfile" VALUE="full_path_to_your_directory">

    <NAME> can be anything you want it to be. It is a symbolic name that will identify the form on the response summaries you will receive. Just make sure that you do not assign the same name to any other <INPUT> tags.

    For <VALUE>, write in the full path to your world-writeable directory. Here are the full path names for each type of EarthLink Sprint account:

    Free 6MB Web site: /www/htdocs/free/<username>/webdocs/...

    Users Web site: /www/htdocs/user/<username>/webdocs/...

    Business Web site: /www/htdocs/biz/<username>/webdocs/...

    Domain Web site: /www/htdocs/domain/<username>/webdocs/...

    Replace the ellipses after webdocs/ in the paths above with the rest of the path to your specific data file. For example, to store data in the file called mydata in the data directory, use this path name:

    /www/htdocs/<account-type>/<username>/webdocs/data/mydata

    NOTE: If mydata doesn't exist, appendto will create it. (Do not upload an empty file into your directory for this.)

  5. Say Thank You. Somewhere between the <FORM> and </FORM> tags, you should also include this hidden <INPUT> tag, which will send everyone who fills out one of your forms to a page that thanks them:

    <INPUT TYPE="HIDDEN" NAME="thankURL" VALUE="http://URL_for_a_thankyou_page">

    Again, <NAME> can be anything you want it to be. Just make sure that you do not assign this name to any other <INPUT> tags. In the <VALUE> field, place the URL (in quotation marks) for a page thanking the respondent for submitting the form.