Home  |  METU  |  
 
 
Network Services
E-mail Services
User Support
Web Services
E-services
Licensed Software
Security
Facilities
About CC
 
Announcements and Events
Policies & Rules
Publications & Documents
Forms


Admin Panel
  >> Web Services   >> Creating Web Pages on Central Servers   >> General Information >>Creating Survey and Feedback Forms in Web Pages
Creating Survey and Feedback Forms in Web Pages

You can use the sample forms below, which use BFormMail/FormMail programs, in your own pages, first by copying the source codes and then changing the necessary settings according to the explanations found in the page below. Please forward your questions to hotlinemetu.edu.tr.

 

Description of the settings in the BFormMail and FormMail programs

In order to use BFormMail/FormMail program on METU central web server, you have to put the html codes below into the form/survey file you create (Row numbers are put for explaining the codes, please do not include them in your codes.) Following this, you have to define the predefined values required by BformMail.pl program. Sample survey/form page and its source code can be viewed from this page.

< FORM ACTION="http://www.metu.edu.tr/cgi-bin/BFormMail.pl" METHOD="post" >
(1) < INPUT NAME="recipient" TYPE="hidden" VALUE="*****@metu.edu.tr"  >
(2) < INPUT NAME="subject" TYPE="hidden" VALUE="Formmail Deneme Formu" >
(3) < INPUT NAME="required" TYPE="hidden" VALUE="Q1,Q2,Q3,Q4,Q5">
(4) < INPUT NAME="env_report" TYPE="hidden" VALUE="REMOTE_HOST, REMOTE_ADDR,
REMOTE_USER, HTTP_USER_AGENT" >
(5) < INPUT NAME="print_config" TYPE="hidden" VALUE="realname,email" >
(6) < INPUT NAME="sort" TYPE="hidden" VALUE="order: Q1,Q2,Q3,Q4,Q5" >
(7) < INPUT NAME="title" TYPE="hidden" VALUE="Thank you " >
(8) < INPUT NAME="bgcolor" TYPE="hidden" VALUE="#FFFFFF" >
(9) < INPUT TYPE="hidden" NAME="append_db" VALUE="data/data.txt" >
(10) < INPUT TYPE="hidden" NAME="db_fields" VALUE="Q1,Q2,Q3,Q4,Q5">
(11) < INPUT TYPE="hidden" NAME="db_delimiter" VALUE="|">
(12) < INPUT TYPE="hidden" NAME="redirect" VALUE="url">

 

1.row: "recipient" parameter; The e-mail address(es) to which the replies of the survey will be sent. If the recipient address or addresses are not stated, the "Error: Bad/No Recipient" message will be displayed.

2.row: "subject" parameter; The statement to be displayed in the subject line of e-mail reply.

3.row: "required" parameter; The form fields, which must definitely be filled, are stated by this parameter.

4.row: "env_report"; Abbreviation of "Environmental Report" including information such as REMOTE_HOST and REMOTE_ADDR of the user.

5.row: "print_config" parameter; Adds the e-mail address and the name of the person to the e-mail message which is sent as soon as the form is filled out. (To make use of this parameter, e-mail and name-surname variables should be defined in the order of "email" and "realname" within the code. If the e-mail address and the name-surname information are not asked for within the form, this parameter is unnecessary to use.)

6.row: "sort" parameter; Used to order the values of the parameters in the e-mail message sent, as soon as the form is filled out. All variables should be included in this parameter. Otherwise, the value of a variable will not be displayed in the e-mail message, even if it is filled in.

7. and 8.rows: "title" and "bgcolor" parameters; After the form is filled out and the "submit" button is clicked, a new page is displayed on the screen. These parameters are used to define the title and the background color of that new page.

9., 10. and 11. rows: "append_db", "db_fields" and "db_delimiter" parameters; BFormMail program can be used to record the replies of the filled out forms into a text file (*.txt). These parameters define the settings of that text file. (This is not a required case; if you do not need to record the replies into a text file, you do not need to include these parameters.)

9.row: "append_db" parameter; Defines in which text file the data will be kept. The text file should be created beforehand and its permission rights should be set as 622. Path of the file should be defined completely.You can find detailed information about files' access rights from here.

Example: /home###/usercode/wwwhome/data.txt .
In order to see your home directory in UNIX environment, please use the following command (enter your usercode beginning with "www" in stead of "usercode"):

~usercode

Then, a statement will be displayed similar to the one below:
/home###/usercode: is a directory

However (for web user codes in central systems), if the adress which has the form, is in the order of www.***.metu.edu.tr, the adress defination of place where the form datas will be saved, should be like /home/www***/data.txt

10.row: "db_fields" parameter; Defines the names of the variables to be recorded in the text file. They should be stated in the same way as the "sort" parameter.

11.row: "db_delimiter" parameter; Defines the delimiting character placed between each value. Generally "|" pipe character is used for this purpose.

Example: After three persons filled out the form including two questions, the values are recorded in the text file as below:

filling date of first person|value of 1.question|value of 2.question
filling date of second person|value of 1.question| |
filling date of third person| |value of 2.question

Values of empty replies are displayed by " " (blank) characters. At the end, a matrix of questions and respondents is created within this text file. (including cells with number of respondents X number of questions) After the survey is completed, the text file can be opened by any spreadsheet program (excel, spss,open office etc.) and further analysis can be made.

12.row: "redirect" parameter; Defines the web page address to which the survey participant is redirected, as soon as the survey is completed. For instance, redirected web page can be the main page of the survey or a thanks page.