CGIFILE uses a template and ACTION like CGIEMAIL, but appends information to a file rather than mailing it. These directions assume that you have already created a web page form and template file using CGIEMAIL. If not, please review the CGIEMAIL documentation for directions on how to create these files.
CGIFILE requires a file called "incoming.txt". The incoming.txt file stores the responses submitted by the form in the format specified in the template file.
In this example, we will create a directory called "feedback".
Example:
Example:
Using the CGIEMAIL example, move the web page form "feedback.htm" and template file "feedback.txt" stored in the public_html directory to the new directory "feedback". This will need to be done in two steps.
Step 1:
Step 2:
Example:
Example:
Example:
In the CGIEMAIL example, the template file is called "feedback.txt".
The contents of the cgiemail template file look like this. The results are listed below with headings so the e-mail will be readable.:
From: [email] (optional)
To: userid@sfsu.edu
Subject: Sample Questionnaire
Student: [student]
Term: [term]
Major: [major]
My comments: [comments]
Change the cgifile template file to look like this. The results here are shown without headings -- the data is comma delimited with a single carriage return at the end of the line so it can easily be imported to another program.:
[email],[student],[term],[major],[comments]
Example:
In the CGIEMAIL example, the web page form is called "feedback.htm".
Using the down arrow key, scroll down until you see code similar to the following:
<form METHOD="POST" ACTION=""[servername]/cgi- bin/cgiemail/~accountname/feedback.txt">
Edit the FORM tag to point to CGIFILE:
<form METHOD="POST" ACTION="[servername]/cgi-bin/cgifile/~accountname/feedback/feedback.txt">
Also, check the following:
Example:
Example:
Step 1:
Step 2:
To pickup the results/data from your form you can ftp incoming.txt to your workstation/PC.