home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Guests / GreekMarble / scripts / readme < prev    next >
Text File  |  2017-09-21  |  17KB  |  447 lines

  1. ##############################################################################
  2. # FormMail            Version 1.5                     #
  3. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                 #
  4. # Created on 6/9/95             Last Modified: 2/5/96                 #
  5. # Scripts Found at:        http://www.worldwidemart.com/scripts/         #
  6. ##############################################################################
  7. # If you run into any problems while trying to configure this scripts, help  #
  8. # is available.  The steps you should take to get the fastest results, are:  #
  9. #       1) Read this file thoroughly                         #
  10. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  11. #               http://www.worldwidemart.com/scripts/faq/             #
  12. #       3) If you are still having difficulty installing this script, send   #
  13. #          e-mail to: scripts-help@tahoenet.com                     #
  14. #          Include any error messages you are receiving and as much detail   #
  15. #          as you can so we can spot your problem.  Also include the variable#
  16. #          configuration block that is located at the top of the script.     #
  17. #                                         #
  18. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  19. ##############################################################################
  20. # COPYRIGHT NOTICE                                 #
  21. # Copyright 1996 Matthew M. Wright  All Rights Reserved.             #
  22. #                                         #
  23. # FormMail may be used and modified free of charge by anyone so long as this #
  24. # copyright notice and the comments above remain intact.  By using this      #
  25. # code you agree to indemnify Matthew M. Wright from any liability that      # 
  26. # might arise from it's use.                             #
  27. #                                                                            #
  28. # Selling the code for this program without prior written consent is         #
  29. # expressly forbidden.  In other words, please ask first before you try and  #
  30. # make money off of my program.                                              #
  31. #                                                                            #
  32. # Obtain permission before redistributing this software over the Internet or #
  33. # in any other medium.    In all cases copyright and header must remain intact #
  34. ##############################################################################
  35.  
  36.  
  37. This script can be used as a universal WWW form --> E-mail gateway.  There are 
  38. just a few restrictions on the HTML Forms and what they have to have in 
  39. them.  The script works for both the POST and GET form methods.
  40.  
  41. The script, FormMail.pl, needs to be placed in your server's cgi-bin and the 
  42. anonymous WWW user must have the ability to read/execute the script.  If 
  43. you do not have access to your server's cgi-bin, yet you can execute cgi 
  44. scripts, you may want to try adding a .cgi extension to the FormMail.pl, 
  45. so you could move it to FormMail.cgi.
  46.  
  47. Setting Up the FormMail Script:
  48. ===============================
  49.  
  50. The FormMail.pl script does not have to be extensively configured to get 
  51. it to work.  There are only two variables in the perl file which you will 
  52. need to define along with changing the top line of your script to match 
  53. the location of you Perl interpreter.
  54.  
  55. Necessary Variables:
  56. --------------------
  57.  
  58.   $mailprog = "/usr/lib/sendmail";
  59.     This variable must define the location to your server's sendmail 
  60.     program.  If this is incorrect, form results will not be mailed to you.
  61.  
  62.   @referers = ('www.worldwidemart.com','worldwidemart.com','206.31.72.203');
  63.     This array allows you to define the domains that you will allow 
  64.     forms to reside on and use your FormMail script.  If a user tries to 
  65.     put a form on another server, that is not www.worldwidemart.com, they 
  66.     will receive an error message when someone tries to fill out their form.
  67.  
  68. Your formmail program is now configured.
  69.  
  70. -----------------------------------------------------------------------------
  71.  
  72. Form Configuration:
  73. ===================
  74.  
  75. The action of your form needs to point towards this script (obviously), and 
  76. the method must be POST or GET in capital letters.  Version 1.5 of FormMail 
  77. offers many new ways to code your form to tailor the resulting HTML page 
  78. and the way the script performs.  Below is a list of form fields you can 
  79. use and how to implement them.
  80.  
  81. Necessary Form Fields:
  82. ======================
  83.  
  84. There is only one form field that you must have in your form, for 
  85. FormMail to work correctly.  This is the recipient field.
  86.  
  87. Field: recipient
  88.  
  89. Description: This form field allows you to specify to whom you wish for your 
  90. form results to be mailed.  Most likely you will want to configure this 
  91. option as a hidden form field with a value equal to that of your e-mail 
  92. address.
  93.  
  94. Syntax:
  95.  
  96. <input type=hidden name="recipient" value="email@your.host.xxx">
  97.  
  98. -----------------------------------------------------------------------------
  99.  
  100. Optional Form Fields:
  101. =====================
  102.  
  103. Field: subject
  104.  
  105. Description: The subject field will allow you to specify the subject that 
  106. you wish to appear in the e-mail that is sent to you after this form has 
  107. been filled out.  If you do not have this option turned on, then the 
  108. script will default to a message subject: WWW Form Submission
  109.  
  110. Syntax:
  111.  
  112. If you wish to choose what the subject is:
  113. <input type=hidden name="subject" value="Your Subject">
  114.  
  115. To allow the user to choose a subject:
  116. <input type=text name="subject">
  117.  
  118. -----------------------------------------------------------------------------
  119.  
  120. Field: email
  121.  
  122. Description: This form field will allow the user to specify their return 
  123. e-mail address.  If you want to be able to return e-mail to your user, I 
  124. strongly suggest that you include this form field and allow them to fill 
  125. it in.  This will be put into the From: field of the message you receive.
  126.  
  127. Syntax:
  128.  
  129. <input type=text name="email">
  130.  
  131. -----------------------------------------------------------------------------
  132.  
  133. Field: realname
  134.  
  135. Description:  The realname form field will allow the user to input their 
  136. real name.  This field is useful for identification purposes and will 
  137. also be put into the From: line of your message header.
  138.  
  139. Syntax: 
  140.  
  141. <input type=text name="realname">
  142.  
  143. -----------------------------------------------------------------------------
  144.  
  145. Field: redirect
  146.  
  147. Description:  If you wish to redirect the user to a different URL, rather 
  148. than having them see the default response to the fill-out form, you can 
  149. use this hidden variable to send them to a pre-made HTML page.
  150.  
  151. Syntax:
  152.  
  153. To choose the URL they will end up at:
  154. <input type=hidden name="redirect" value="http://your.address/to/file.html">
  155.  
  156. To allow them to specify a URL they wish to travel to once the form is 
  157. filled out:
  158. <input type=text name="redirect">
  159.  
  160. -----------------------------------------------------------------------------
  161.  
  162. Field: required
  163.  
  164. Version Added: 1.3
  165.  
  166. Description: You can now require for certain fields in your form to be 
  167. filled in before the user can successfully submit the form.  Simply place 
  168. all field names that you want to be mandatory into this field.  If the 
  169. required fields are not filled in, the user will be notified of what they 
  170. need to fill in, and a link back to the form they just submitted will be 
  171. provided.
  172.  
  173. Syntax:
  174.  
  175. If you want to require that they fill in the email and phone fields in 
  176. your form, so that you can reach them once you have received the mail, 
  177. use a syntax like:
  178. <input type=hidden name="required" value="email,phone">
  179.  
  180. -----------------------------------------------------------------------------
  181.  
  182. Field: env_report
  183.  
  184. Version Added: 1.3
  185.  
  186. Description: Allows you to have Environment variables included in the 
  187. e-mail message you receive after a user has filled out your form.  Useful 
  188. if you wish to know what browser they were using, what domain they were 
  189. coming from or any other attributes associated with environment 
  190. variables.  The following is a short list of valid environment variables 
  191. that might be useful:
  192.  
  193. REMOTE_HOST    - Sends the hostname making a request.
  194. REMOTE_ADDR    - Sends the IP address of the remote host making the request.
  195. REMOTE_USER    - If server supports authentication and script is 
  196.           protected, this is the username they have authenticated as.
  197.           *This is not usually set.*
  198. REMOTE_IDENT    - If HTTP server supports RFC 931 identification, then 
  199.           this variable will be set to the remote user name 
  200.           retrieved from the server. *This is not usually set.*
  201. HTTP_USER_AGENT    - The browser the client is using to send the request.  
  202.           General format: software/version library/version
  203.  
  204. There are others, but these are a few of the most useful.
  205.  
  206. Syntax:
  207.  
  208. If you wanted to find the remote host and browser sending the request, 
  209. you would put the following into your form:
  210. <input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
  211.  
  212. -----------------------------------------------------------------------------
  213.  
  214. Field: sort
  215.  
  216. Version Added: 1.4
  217.  
  218. Description: This field allows you to choose the order in which you wish 
  219. for your variables to appear in the e-mail that FormMail generates.  You 
  220. can choose to have the field sorted alphabetically or specify a set order 
  221. in which you want the fields to appear in your mail message.  By leaving 
  222. this field out, the order will simply default to the order in which the 
  223. browsers sends the information to the script (which isn't always the 
  224. exact same order they appeared in the form.)  When sorting by a set order 
  225. of fields, you should include the phrase "order:" as the first part of 
  226. your value for the sort field, and then follow that with the field names 
  227. you want to be listed in the e-mail message, separated by commas.
  228.  
  229. Syntax:
  230.  
  231. To sort alphabetically:
  232. <input type=hidden name="sort" value="alphabetic">
  233.  
  234. To sort by a set field order:
  235. <input type=hidden name="sort" value="order:name1,name2,etc...">
  236.  
  237. -----------------------------------------------------------------------------
  238.  
  239. Field: print_config
  240.  
  241. Version Added: 1.5
  242.  
  243. Description: print_config allows you to specify which of the config 
  244. variables you would like to have printed in your e-mail message.  By 
  245. deafult, no config fields are printed to your e-mail.  This is because 
  246. the important form fields, like email, subject, etc... are included in 
  247. the header of the message.  However some users have asked for this option 
  248. so they can have these fields printed in the body of the message.  The 
  249. config fields that you wish to have printed shoul dbe in the value 
  250. attribute of your input tag separated by commas.
  251.  
  252. Syntax:
  253.  
  254. If you want to print the email and subject fields in the body of your 
  255. message, you would place the following form tag:
  256. <input type=hidden name="print_config" value="email,subject">
  257.  
  258. ----------------------------------------------------------------------------
  259.  
  260. Field: title
  261.  
  262. Version Added: 1.3
  263.  
  264. Description: This form field allows you to specify the title and header 
  265. that will appear on the resulting page if you do not specify a redirect URL.
  266.  
  267. Syntax:
  268.  
  269. If you wanted a title of 'Feedback Form Results':
  270. <input type=hidden name="title" value="Feedback Form Results">
  271.  
  272. -----------------------------------------------------------------------------
  273.  
  274. Field: return_link_url
  275.  
  276. Version Added: 1.3
  277.  
  278. Description:  This field allows you to specify a URL that will appear, as 
  279. return_link_title, on the following report page.  This field will not 
  280. be used if you have the redirect field set, but it is useful if you allow 
  281. the user to receive the report on the following page, but want to offer 
  282. them a way to get back to your main page.
  283.  
  284. Syntax:
  285.  
  286. <input type=hidden name="return_link_url" 
  287.                      value="http://your.host.xxx/main.html">
  288.  
  289. -----------------------------------------------------------------------------
  290.  
  291. Field: return_link_title
  292.  
  293. Version Added: 1.3
  294.  
  295. Description: This is the title that will be used to link the user back to 
  296. the page you specify with return_link_url.  The two fields will be shown 
  297. on the resulting form page as:
  298.  
  299. <ul>
  300. <li><a href="return_link_url">return_link_title</a>
  301. </ul>
  302.  
  303. Syntax:
  304.  
  305. <input type=hidden name="return_link_title" value="Back to Main Page">
  306.  
  307. -----------------------------------------------------------------------------
  308.  
  309. Field: background
  310.  
  311. Version Added: 1.3
  312.  
  313. Description: This form field allow you to specify a background image 
  314. that will appear if you do not have the redirect field set.  This image 
  315. will appear as the background to the form results page.
  316.  
  317. Syntax:
  318.  
  319. <input type=hidden name="background" value="http://your.host.xxx/image.gif">
  320.  
  321. -----------------------------------------------------------------------------
  322.  
  323. Field: bgcolor
  324.  
  325. Version Added: 1.3
  326.  
  327. Description:  This form field allow you to specify a bgcolor for the 
  328. form results page in much the way you specify a background image.  This 
  329. field should not be set if the redirect field is.
  330.  
  331. Syntax:
  332.  
  333. For a background color of White:
  334. <input type=hidden name="bgcolor" value="#FFFFFF">
  335.  
  336. -----------------------------------------------------------------------------
  337.  
  338. Field: text_color
  339.  
  340. Version Added: 1.3
  341.  
  342. Description: This field works in the same way as bgcolor, except that it 
  343. will change the color of your text.
  344.  
  345. Syntax:
  346.  
  347. For a text color of Black:
  348. <input type=hidden name="text_color" value="#000000">
  349.  
  350. -----------------------------------------------------------------------------
  351.  
  352. Field: link_color
  353.  
  354. Version Added: 1.3
  355.  
  356. Description: Changes the color of links on the resulting page.  Works in 
  357. the same way as text_color.  Should not be defined if redirect is.
  358.  
  359. Syntax:
  360.  
  361. For a link color of Red:
  362. <input type=hidden name="link_color" value="#FF0000">
  363.  
  364. -----------------------------------------------------------------------------
  365.  
  366. Field: vlink_color
  367.  
  368. Version Added: 1.3
  369.  
  370. Description: Changes the color of visited links on the resulting page.  
  371. Works exactly the same as link_color.  Should not be set if redirect is.
  372.  
  373. Syntax:
  374.  
  375. For a visited link color of Blue:
  376. <input type=hidden name="vlink_color" value="#0000FF">
  377.  
  378. -----------------------------------------------------------------------------
  379.  
  380. Field: alink_color
  381.  
  382. Version Added: 1.4
  383.  
  384. Description: Changes the color of active links on the resulting page. 
  385. Works exactly the same as link_color.  Should not be set if redirect is.
  386.  
  387. Syntax:
  388.  
  389. For a visited link color of Blue:
  390. <input type=hidden name="alink_color" value="#0000FF">
  391.  
  392. -----------------------------------------------------------------------------
  393.  
  394. Any other form fields that appear in your script will be mailed back to 
  395. you and displayed on the resulting page if you do not have the redirect 
  396. field set.  There is no limit as to how many other form fields you can 
  397. use with this form, except the limits imposed by browsers and your server.
  398.  
  399. -----------------------------------------------------------------------------
  400.  
  401. Some of the possible uses of this script are:
  402.  
  403. 1) You want to have a form that will be mailed to you, but aren't sure how to 
  404.    write the scripting for it.
  405. 2) You are the webmaster of your site and want to allow users to use forms, 
  406.    but not to have their own cgi-bin directories, which can cause 
  407.    security risks to your system.  You can set this script up and then 
  408.    allow all users to run off of it.
  409. 3) Want to have one script to parse all of your html forms and mail them 
  410.    to you.
  411.  
  412. -----------------------------------------------------------------------------
  413.  
  414. History:
  415. Version 1.0     6/11 -  This script was created.
  416. Version 1.1     8/3  -  A major hole in the script which allowed users to run 
  417.                         commands under your server's uid was disabled, thanks 
  418.                         to Paul Phillips, who noticed the error.
  419.                      -  The ability to redirect the user to a specified HTML 
  420.                         file after they filled out a form was added.
  421. Version 1.2     9/23 -  If the form field is one of the required or optional 
  422.                         'special' fields, such as redirect, recipient, 
  423.                         subject, email, realname, etc... the script will not 
  424.                         print these fields to either your mail message or to 
  425.                         the user's screen when they are returned to a generic 
  426.                         form response.  It helps you so that things do not 
  427.                         get duplicated.
  428. Version 1.3    1/21 -  Much needed update finally completed
  429.              -  Added form fields: env_report, bgcolor, 
  430.                 background, link_color, vlink_color, title,
  431.                 text_color, return_link_title, return_link_url 
  432.             and required.
  433.              -  Security hole, which allowed any user on any 
  434.             system to bum off of your formmail script, has been 
  435.             plugged up with the @referers variable.
  436.              -  Report style in return html and e-mail touched 
  437.             up a bit.
  438. Version 1.4    1/23 -  Added options: sort, alink_color
  439.              -  Fixed a few bugs from Version 1.3, namely the fact 
  440.             that the link_colors weren't working well.
  441.              -  FormMail now supports both the GET and POST methods.
  442. Version 1.5    2/5  -  Sorting of Fields in E-Mail Response Fixed.
  443.              -  print_config option added.
  444.  
  445. -----------------------------------------------------------------------------
  446. Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
  447.