home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / DEVELOP / CGINB123 / readme < prev   
Text File  |  1997-10-07  |  9KB  |  267 lines

  1. 6 October 1997
  2.  
  3.                               CGI Notebook v1.23
  4.  
  5.    It is assumed that you are the Webmaster administrating the server and
  6.    are already familiar with the HTML language tags and their uses. Also,
  7.    that you understand the operation of the OS/2 Warp environment and can
  8.    perform the described tasks in the documentation.
  9.  
  10.  
  11. This software is provided on an "as-is" basis.  I offer no warranty on this
  12. software whatsoever, and you use it at your own risk.
  13.  
  14. This software is freeware so you may freely use and distribute it.
  15.  
  16.  
  17. 1. What is the CGI notebook?
  18.  
  19.     The CGI Notebook is a CGI (Common Gate Interface) program  which allows
  20. you to ask users of your  Web Pages  for some  information  and records the 
  21. information to desired file.  In addition,  visitors of your site  can view
  22. the information if you allow it.
  23.     I wrote the program to help Webmasters which are not familiar with  CGI 
  24. programming to record forms (<FORM> tag) data in a file. The Notebook
  25. will help to make Guest Book, Registration Form and so on ...
  26.  
  27. 2. System requirements.
  28.  
  29.     OS/2 Warp 3 or later and Web Server software (e.g. Internet Connection 
  30. Server) installed on your computer. 
  31.  
  32. 3. Installation.
  33.  
  34.     Archive cginb123.zip contains:
  35.         nb.exe  -  executable file
  36.         nb.cfg  -  notebook configuration file
  37.         nb.htm  -  example use of the Notebook
  38.         nb.rsp  -  response file
  39.         nb.snb  -  template file for viewing notebook data
  40.         readme  -  this file
  41.  
  42. NOTE: 
  43. ----
  44. If you use PlanetWide OS/2 Web Server you have to delete lines
  45.  
  46. Pragma: no-cache
  47. Cache-Control: no-cache
  48. Content-Type: text/html
  49.  
  50. from the beginning of files nb.rsp and nb.snb. 
  51. It is nesessary becouse Planet Wide OS/2 Web Server is not full CGI compliant.
  52. ENDNOTE
  53. -------
  54.      
  55.     It is easy to install the Notebook. 
  56.     Make directory /notebook inside /cgi-bin directory of your Web server, 
  57. then put files nb.exe, nb.cfg into /cgi-bin and nb.rsp, nb.snb  into 
  58. /cgi-bin/notebook directory.
  59.  
  60.     HTML file nb.htm contains an example of use the Notebook and you may 
  61. put the file whereever you want in your Web pages directories.
  62.  
  63. 4. Using the Notebook.
  64.  
  65.     4.1. Simple use.
  66.  
  67.     Type URL http://yourhost/path_to_nb.htm/nb.htm in your browser. 
  68. You will see example of using the Notebook.
  69.  
  70.     4.2. Normal use.
  71.     4.2.1. File nb.cfg - setting up notebooks.
  72.  
  73.     First you have to describe a notebook in nb.cfg file.
  74. The file contains a number of lines which describe different notebooks.
  75.  
  76. Format of nb.cfg file:
  77.  
  78. identificator1=notebookfile1,responsefile1,viewtemplate1,wrapwidth1
  79. identificator2=notebookfile2,responsefile2,viewtemplate2,wrapwidth2
  80. ...
  81.  
  82. where 
  83.     identificatorI - a key string to select the notebook
  84.     notebookfileI  - file which data are stored in
  85.     responsefileI  - file which is sent to remote after submitting
  86.     viewtemplateI  - file which uses as a template for viewing
  87.                      notebook data
  88.     wrapwidthI     - decimal digit (0-256), to limit the line to wrapwidth 
  89.                      characters when viewing the notebook, 0 means no wrap.
  90.  
  91. Note: Format of lines in nb.cfg must be quite similar to above one.
  92.       No spaces and tabs are allowed.
  93.  
  94. Example of nb.cfg:
  95.  
  96. main=notebook/datafile,notebook/nb.rsp,notebook/nb.snb,64
  97.  
  98. Above line says that notebook "main" uses file "notebook/datafile" to record 
  99. data, file "notebook/nb.rsp" will be sent to remote after submitting and
  100. file notebook/nb.snb will be used as template for view the notebook.
  101.  
  102. main = notebook/datafile , notebook/nb.rsp,notebook/nb.snb, 64
  103.  
  104. Above line is wrong because of spaces in it.
  105.  
  106.     4.2.2. Recording data in a notebook 
  107.  
  108.     After describing a notebook in nb.cfg, you have to insert to your Web page 
  109. the <FORM> tag:
  110.  
  111.    <FORM METHOD="POST" ACTION="/cgi-bin/nb">
  112.     <INPUT TYPE="hidden" NAME="notebookident" VALUE="main">
  113.  
  114.     <!-- Your input elements here -->
  115.  
  116.     <INPUT TYPE="submit" VALUE="Submit to the notebook"> <INPUT TYPE="reset" VALUE="Clear Note">  
  117.    </FORM>
  118.     
  119.     Values are:
  120.  
  121.         notebookident - identificator of the notebook (see nb.cfg format)
  122.  
  123.     If you use Russian language then you have to add line:
  124.  
  125.     <INPUT TYPE="hidden" NAME="codepage" VALUE="ibm866">
  126.  
  127. in FORM tag.
  128.  
  129.     codepage - ibm866, win1251 or koi8r for translation 
  130.                beetwin cyrillic codepages. Set codepage which your
  131.                clients use. 
  132.  
  133.     If you use only English then don't insert codepage line in FORM tag
  134. becouse if codepage variable is defined  then the CGI notebook will use
  135. Russian messages instead of English.
  136.  
  137.     
  138.     Inside the form you may insert any input elements.
  139.  
  140.     Data are stored in the specified file ( notebookfileI in nb.cfg) in the 
  141. next format:
  142.  
  143. :START
  144. Message from : remote_address
  145. :name_of_input_element1
  146. value_of_input_element1
  147. :name_of_input_element2
  148. value_of_input_element2
  149. .......................
  150. :END
  151.  
  152.     4.2.3. Multiple notebooks support
  153.  
  154.     File 'nb.cfg' and 'notebookident' are needed for handle a number of 
  155. different notebooks.
  156.     For example, you need 2 different notebooks. First notebook is Guestbook,
  157. second is Notebook_for_Clients.
  158. You can do it.
  159. File nb.cfg should contains data like that:
  160.  
  161. Guestbook=notebook/guests,notebook/guests.rsp,notebook/nb.snb,64
  162. Notebook_for_Clients=notebook/clients,notebook/clients.rsp,notebook/nb.snb,64
  163.  
  164. Then you write in your guest page:
  165.  
  166.    <FORM METHOD="POST" ACTION="/cgi-bin/nb">
  167.     <INPUT TYPE="hidden" NAME="notebookident" VALUE="Guestbook">
  168.  
  169.     <!-- Your input elements here -->
  170.  
  171.     <INPUT TYPE="submit" VALUE="Submit to the notebook"> <INPUT TYPE="reset" VALUE="Clear Note">  
  172.    </FORM>
  173.  
  174. and in clients page
  175.  
  176.    <FORM METHOD="POST" ACTION="/cgi-bin/nb">
  177.     <INPUT TYPE="hidden" NAME="notebookident" VALUE="Notebook_for_Clients">
  178.  
  179.     <!-- Your input elements here -->
  180.  
  181.     <INPUT TYPE="submit" VALUE="Submit to the notebook"> <INPUT TYPE="reset" VALUE="Clear Note">  
  182.    </FORM>
  183.  
  184. So you have 2 different notebooks.
  185.  
  186. First notebook: 
  187. ident = Guestbook
  188. file to save data = notebook/guests
  189. file to send to remote = notebook/guests.rsp
  190. template to view the notebook = notebook/nb.snb
  191.  
  192. Second notebook: 
  193. ident = Notebook_for_Clients
  194. file to save data = notebook/clients
  195. file to send to remote = notebook/clients.rsp
  196. template to view the notebook = notebook/nb.snb
  197.  
  198.     4.2.4. Viewing data in notebook
  199.  
  200.     Version 1.23 of the CGI notebook allow to view notebook data with Web 
  201. browser.
  202.  
  203.     To view notebook data you have to insert next FORM tag in your Web page:
  204.  
  205.    <FORM METHOD="POST" ACTION="/cgi-bin/nb">
  206.     <INPUT TYPE="hidden" NAME="notebookident" VALUE="view:main">
  207.     <INPUT TYPE="submit" VALUE="View the Notebook">
  208.    </FORM>
  209.  
  210.     So you have to prepend identificator of a notebook to be viewed with 'view:'.
  211. File nb.snb is a template which is used to show notebook data.
  212.  
  213. NOTE: 
  214. ----
  215. If you use Apache Web Server you have to replace
  216. ACTION="/cgi-bin/nb"
  217. with
  218. ACTION="/cgi-bin/nb.exe"
  219.  
  220. ENDNOTE
  221. -------
  222.  
  223. 5. CGI Notebook Revisions.
  224.  
  225. v1.00 - first release, non public, has a great security bug
  226. v1.01 - cyrillic codepage support added. Still non public. 
  227.         Security bug not fixed.
  228. v1.10 - security bug fixed. First version with nb.cfg.
  229. v1.20 - View notebook feature added. Reverse DNS lookup added.
  230. v1.21 - Added support for ICS and GoServer. Little changes in documentaion.
  231. v1.22 - No changes in executables. Corrections in nb.rsp, nb.snb and readme.
  232.         Apache server support: note in documentation.
  233. v1.23 - Little bug in view feature fixed. Added word wrap feature. 
  234.         Changes in documentation. Format of nb.cfg is changed.
  235.  
  236. 6. Acknowledgements.
  237.  
  238.     Special thanks to Ted Romer, who has helped me in improving the CGI 
  239. Notebook.
  240.  
  241. 7. Conclusion.
  242.  
  243.     If you have ANY problems with the Notebook that I can help you with, 
  244. send me E-mail to 
  245.  
  246. Vitali.Pelenyov@dpt.ustu.ru 
  247.  
  248. or leave your message in my notebook: 
  249.  
  250. http://194.226.228.11/eng/nb.htm
  251.  
  252. Latest version of the Notebook is available in my FTP archive
  253.  
  254. ftp://194.226.228.11/pub/os2/tcpip
  255.  
  256. Look for cginb???.zip.
  257.  
  258. My site is up from 4 to 11 GMT.
  259.  
  260. If you use the Notebook, send me some mail and let me know. 
  261. I would love to hear from you.
  262.  
  263. Sorry for any typos and bad grammar. I will gladly accept any corrections to
  264. this short manual.
  265.  
  266. Vitali Pelenyov ( Vitali.Pelenyov@dpt.ustu.ru )
  267.