ReadMe File for Starter Version of BizDB ################################################################## # # BizDB - A Web Database Management System # # This is a simple, powerful, flexible, affordable and secured Flat # File Database System with ADD, EDIT, DELETE, SEARCH, DISPLAY as # well as IMAGE UPLOAD functions. Updates to database records can be # password-protected on file or individual record level with complete # Webmaster control. Definition of database fields and output layouts # are controlled by Html templates. Installation is easy. You don't # need to modify the CGI scripts other than a couple of configuration # parameters, which have been documented clearly, in order to make our # database system working on your server. While we don't need you # to know Perl or CGI programming, we do suggest that you should know # the basic of Html programming in order to develop a set of workable # Webpage/database interface templates yourself. Of course, we are # always available to provide development assistance at a very # reasonable cost. # # As any other flat file database systems, BizDB is designed for # small to medium sized databases only with relatively simple database # requirements. If your overall database size is larger than 2-3MB # ( depending on your server and system capacity ) and you have lot of # data fields to search, we suggest you to consider a relational database # solution. # ################################################################## # # Demonstration Website: http://www.cnctek.com/bizdb-html/ # E-mail: cnctek@cnctek.com # # MINIMUM SERVER REQUIREMENTS: # # Runs on any Unix, Linux or Windows NT Operating System; # Provides full FTP access (or access via a Control Panel); # Supports Perl and cgi-bin; Allows creation of files and # directories by cgi programs. # # NOTE: # # ************************************************************* # THE LICENCE OF THIS SOFTWARE IS FOR SUPPORTING WEBSITE(S) ON # THE SAME DOMAIN NAME. IF YOU WANT TO SUPPORT MORE THAN 1 DOMAIN # NAMES, EVEN THEY ARE ON THE SAME SERVER, YOU WILL NEED TO ORDER # MULTIPLE LICENCES. # # ORDER OF THIS SOFTWARE IS NOT REFUNDABLE. WE ARE GLAD TO # PROVIDE TECHNICAL ASSISTANCE AT REASONABLE COST. # ************************************************************* # # COPYRIGHT NOTICE # # The BizDB software is a product of CNC Technology. All rights reserved. # Only the user with our permission can use and modify this software. # Also permission is granted to execute this software on one domain name # only. Without CNC Technology's permission, no part of this script can be # reproduced ( other than the backup copy ), resold or redistributed to # any other individuals, companies and organizations. # # DISCLAIMER: # # These Scripts are provided on a "As Is" basis. CNC Technology # will not be liable ( nor responsible ) whatsoever for any direct # or indirect damages caused by the use of this Software # ( or Scripts ). # ################################################################## Please read the following paragraphs carefully. This is essential if you want to have a smooth and successful installation. ***FOR EXISTING BIZDB USERS, PLEASE ALSO READ RELEASE-NOTE.TXT FILE.*** When you read this file, we know that you have successfully decompressed our ZIP file using a 32 bits WinZip (or equivalent) program. ################################################################## TABLE OF CONTENTS: A. Contents in our ZIP file B. System Configuration Parameters C. Webpage / Database Interface Templates D. Defining Html Template Filenames E. Defining Database Record Fields F. Other Parameters used by Input-Control Templates G. How to Display Database Field Values on Edit or Search Report H. Installation Procedures - Using FTP or our Installer explained I. Calling the CGI programs by "GET Method" J. Important notes for Windows NT Server Users K. Notes on Supporting Non-English Character Set L. Notes on Supporting Large Number of Database Records M. More Support Notes If You Have Problems During Installation N. Check this section before contacting us - New Features, FAQ, etc. O. Obtaining our Professional Installation Service at affordable rates P. Please Help Us to Help You ################################################################## A. Contents in our ZIP file You should have at least the following files for a standard version of our system: (1) bizdb-installer.cgi - CGI script allowing you to: (1) configure and install a new BizDB database system on your Web server, (2) upload any manually modified file, such as CGI script or Html template, to your Web server.. (2) bizdb-aed.cgi - CGI script used for Add, Edit, Delete and Show any specified database records. (3) bizdb-search.cgi - CGI script used for Search and Display multiple database records at one time. (4) bizdb_upload.cgi - CGI script used for Upload image to the database in conjunction with the Add, Edit and Delete functions. (5) bizdb-add - The sample Add DB record Html template. All database fields (except f1 - f5) are defined and referenced here. (6) bizdb-edit - The sample Edit/Delete/Show DB record Html template. You will use this template to retrieve and edit/delete a specific DB record ( based on record key ). You can also use this template to display all the record keys in your database. (7) bizdb-search - The sample Search DB records Html template. You will use this template to specify search criteria ( keywords ) for the bizdb-search.cgi program. (8) bizdb-summary - The sample Display DB Records Html template. You will use this template to define which and how DB fields are to be displayed in the search report. Fields belonging to the same record will be displayed in a group. This will be repeated for each record until all records or a group of x records are displayed. (9) bizdb-detail - This sample Html template is used to display details of a given record. Unlike the "bizdb-edit" template, the database fields are not updatable. This, in conjunction with the "bizdb-summary" template, can be used to construct a powerful search engine. (10)upload_image - This Html template control the upload of user image from any directory on his PC to a pre-determined server database image directory. The filename of the destination image will be set equal to the record key followed by .gif or .jpg. (11)index.html - The sample homepage for calling various database functions, such as Add, Edit, Delete and Search. You can use this homepage to test your database. (12)ReadMe.txt - It's this document. (13)bizdb - Sample Business Directory database file. (14)testing.cgi - Execute this test script to see if your cgi-bin directory is working properly. This script will also help you to find out the absolute pathname of your Website's home directory. (see Section M for more details) If you have used our development assistance, we will include more files to meet your specific needs. This will be mentioned in a separate document or e-mails. B. System Configuration Parameters: You will have to modify a number of System Configurations Parameters in the Scripts before you can upload them to your CGI-BIN directory. These parameters are CGI script specific, therefore you should read our following sections or the notes on our scripts very carefully. Parameter Name Where Description (1) $maxfields bizdb-aed.cgi Maximum number of DB Fields. bizdb-search.cgi (2) $maxdisplay bizdb-search.cgi Maximum number of records to be extracted in each search. (3) $maxdispscreen bizdb-search.cgi Max Records to be displayed per screen. (4) $security bizdb-aed.cgi Controls security for Add, Edit and Delete DB Records. If not present or = 0, anyone can Add/Edit/Del. If = 1, only the one who knows the supervisor password can Add/Edit/Del. if = 2, each DB record is protected by a unique password. Only the one who knows the user password or the supervisor password can Add/Edit/Del. (5) $superpwd bizdb-aed.cgi Supervisor Password. Anyone (presumably the Webmaster) knowing this password will have the absolute authority to add, edit and delete any database records. Therefore it is essential to keep this password confidential. (6) $addtotop bizdb-aed.cgi Controls adding new and edited records to the database. If "yes", new and edited records will be added to the top of the database, otherwise they will be added to the bottom. (7) $database_dir bizdb-aed.cgi Full pathname of the directory bizdb-search.cgi in which your database is stored. If possible, location of your database file should be stored outside the Html directories. (8) $template_dir bizdb-aed.cgi Full pathname of directory in bizdb-search.cgi which your Html templates are stored. (9) $upload_dir bizdb-aed.cgi Full pathname of directory bizdb-search.cgi where the uploaded (image) file bizdb_upload.cgi will be stored. (10)$max_upload_buffersize Maximum buffer size (in bytes) bizdb_upload.cgi allowed for the image file to be uploaded to the server. (11)$return_url bizdb-aed.cgi Return URL link used by OK and bizdb-search.cgi error messages. bizdb_upload.cgi (12)@valid bizdb-aed.cgi These are the urls (separated bizdb-search.cgi by comma) that are allowed to bizdb_upload.cgi execute this database system. This prevents any of our programs to be accessed by unauthorized Websites. (13)$mailprog bizdb-aed.cgi Location of "sendmail" program. bizdb_upload.cgi You need "sendmail" to send "Notification emails to the Webmaster" if the "recipient" input form field exists in your Html templates. Check with your ISP. ############################################# (14) $serverOS bizdb-aed.cgi Set this parameter to "unix" bizdb_upload.cgi if your server is running on an Unix or Linux operating platform. Set it to "nt" for Windows NT. (15) $charset bizdb-aed.cgi Define the character set to bizdb-search.cgi be used by your database software bizdb_upload.cgi and Html templates. This is required for some foreign languages. Also see section K. ############################################# New parameters introduced after 20th Jan 2001 (16) $check_password_on_showrecord Set this parameter to "yes" bizdb-aed.cgi if you don't want any user to see the content of a record on the Edit record screen unless the record password is matched with password input by the user. Set this parameter to "" if no password checking is required. ############################################# Set the following parameters ($login_ctl, $expiryDate_fld, $expiry_period) only if you have installed our separately priced "LoginControl" add-on feature. Do not change the value of these parameters in the "bizdb-aed.cgi" and "bizdb-search.cgi" scripts if using "BizDB Starter" Version only. (17) $login_ctl bizdb-aed.cgi Login Control for accessing the database. Must set $login_ctl to "" if using "BizDB Starter" alone. If $login_ctl = "yes", users must login to a member area first before executing the Edit and Delete functions. (18) $expiryDate_fld bizdb-aed.cgi Records can be set to expire after bizdb-search.cgi xx days. This variable defines which field number in the database will store the record expiry date. Set this to f20 if field number 20 is used to store the expiry date. Set this variable to "" if there is no need to store the record expiry date. If this field is defined, the search program will ignore the record if the expiry date of the record is empty or expired. (19) $expiry_period bizdb-aed.cgi The expiry date of a newly submitted record will be set to today's date PLUS the xx days defined by $expiry_period. The webmaster can delete a batch of records which are expired between a certain period. If you don't want to expire a record, set it to 99999 days (277 years). This variable must contain a number if $expiryDate_fld is not empty (i.e. ""). If $expiryDate_fld is empty, this variable will be ignored. C. Webpage / Database Interface Templates: You will need to set up a number of Html templates to take input requests, handle new and modified data, upload image files and control output layouts. These templates will be the key interface between users and the database management system. You can use the same set of CGI scripts to handle different databases with different field definitions simply through the use of interface templates. We found that explanation could be difficult without referring to some real examples. We have therefore developed a set of sample templates which you can display them on a second window screen using a text editor. As you read this document, we suggest that you read carefully the content of the relevant template and try to understand its concepts and logics. When you develop your Html templates, we strongly recommend that you start from our sample templates, add and modify the database fields as well as comments to meet your own needs. It is important to backup a copy of the original sample templates before you make your modifications. Please use the following statements to display a Html template with empty fields on the screen: 1. Record Addition: http://www.yourdomain.com/your_cgibin/bizdb-aed.cgi?bizdb-add OR http://www.yourdomain.com/your_directory/bizdb-add.html only if your record addition page has an .htm or .html ending 2. Record Update/Delete: http://www.yourdomain.com/your_cgibin/bizdb-aed.cgi?bizdb-edit 3. Batch Record Deletion: http://www.yourdomain.com/your_cgibin/bizdb-aed.cgi?bizdb-delete 4. Record Search: http://www.yourdomain.com/your_cgibin/bizdb-aed.cgi?bizdb-search OR http://www.yourdomain.com/your_directory/bizdb-search.html only if your record search page has an .htm or .html ending. where bizdb-add, bizdb-edit, bizdb-delete and bizdb-search are Html template filenames. Please also see Section D. *** NOTE *** Your job now is to construct a set of workable and beautifully formatted Web/user interface templates to meet your specific needs. You may use any Web page generator/editor to create your template pages. However, when you prepare your template files, please make sure your top priority is to get the system work. Do not spend too much time on the graphic designs and page layout which you can always refine later. Please remember to use standard and full Html commands. For Html tags which contain your database field names ( eg. or or Example 2: Make sure is always followed by a new line. Example 3: Free Ads Plan 1 Example 4: Male Female IMPORTANT NOTE: Wherever possible, try to store only alphanumeric characters into the "Checkbox", "Radio", and "Selection List" fields. This would make the searching faster. If you still want to include special characters into these fields, make sure you only use & or $ or % or ( or ) or # or ' or + or any combination of them. ******************* Handle your typing with care ********************* ****** UNIX is a case sensitive operating system, so does Perl. ****** **** Applies to all database field names and special control tags **** ******************* Handle your typing with care ********************* If, due to whatever reasons, you have problems in building templates, we are here to provide technical assistance ( at cost ). Just e-mail cnctek@cnctek.com. ************ (C-1) How to use Html Templates to call CGI programs: In our sample, we use the following form control statements: (1) "Add Database Record" HTML Template (Input-Control Template) Filename = bizdb-add This template defines all the fields used in the database and provides an interface for passing the data of those fields to the database. It will call bizdb-aed.cgi when user hits the "submit" command.
The 2nd statement above defines the name of the "Add New Record" template file. (2) "Edit, Delete and Show Database Record" HTML Template (Input-Control Template) Filename = bizdb-edit This template defines all the fields used in the database and provides an interface for passing the current or updated data of those fields back to the database. It will call bizdb-aed.cgi when user hits the "submit" command. The output template file for the "bizdb-aed.cgi" program to display the retrieved record's data on the browser is "bizdb-edit". ( You will need to display the record's data first before you can update it. ) (3) "Search Database Records" HTML Template (Input-Control Template) Filename = bizdb-search This template provides an interface for inputting keywords to the CGI program for searching the database records. If any one of the keywords ( full words or partial-words accepted ) is found on the database record, the record is said to be located. This template will call the "bizdb-search.cgi" program when the user hits the "submit" button. The output template file for the "bizdb-search.cgi" program to substitute data and to display report on the browser is "bizdb-summary". (4) "Display Search Summary Report" Layout Definition Template (Output-Control Template) Filename = bizdb-summary This template defines which database fields are to be displayed, and in what layouts, for the search report. The CGI program will search for any occurrence of **xxx** ( 'xxx' is a database field name or some other reserve words ) in the template and replace it by its actual field value. (Also see section G below. There are certain rules to follow.) (5) "Display Detail Record Report" Layout Definition Template (Output-Control Template) Filename = bizdb-detail (Also see section G below. There are certain rules to follow.) This is another sample template defining which database fields are to be displayed, and in what layouts, for a specific record found on a database search. (6) Upload Gif/JPG Format Image from PC to Server Directory (Upload-Image-Control) Filename = upload_image This HTML template controls the upload of image file (GIF or JPF format) from user's PC to a system defined database image directory. This is the only file not following the conventional naming standard and you must handle this file with care. DO NOT CHANGE THE NAME OF THIS FILE. (C-2) Defining database location, i.e. database filename The "dbname" statement is used to tell the CGI program which database file has to be processed. Specifying the filename is enough. There is no need to tell the directory pathname of the file. The directory pathname is defined within the CGI scripts. The "dbname" statement has the format of: Example: The dbname filename must be made up of the following characters only: a-z, A-Z, 0-9, space (" "), hyphen ("-"), underscore ("_"), dot (".") (C-3) How to instruct CGI program to execute a function or subroutine: If you read the contents of our HTML Templates, you will observe that we are using the following form statements to instruct the CGI program to execute the appropriate subroutine: (1) Sample template - "bizdb-add" The "addtodb" action code is defined in the program "bizdb-aed.cgi". It is called to add a new record to the database. (2) Sample template - "bizdb-edit" The above action codes are defined in the program "bizdb-aed.cgi". Their functions are as follows: "showrecord" to display a database record based on record key, "editrecord" to edit an existing record currently on display, "deletefromdb" to delete an existing record from the database, "showblank " to show a blank Edit/Delete form. (3) Sample template - "bizdb-search" The "searchdbdisplay" action code is defined in the program "bizdb-search.cgi". It is used to search the database based on the keywords specified by the user. A search report will then be displayed on the screen according to the layout specified in the "bizdb-summary" template. D. Defining Html Template Filenames: The "template" statement is used to tell the CGI program which template file has to be processed. You can find it in almost all templates. The CGI program will read in the content of the template, replace certain tags by the actual values determined by the CGI program, and then output the template to the browser. The "template" statement has the format of: Example: In our "bizdb-edit" template, we use: In our "bizdb-search" template, we use: to tell the CGI program that the report format will be defined by the template "bizdb-summary". You may also use other names such as "edit.html" or "edit.tmpl": The template filename must be made up of the following characters only: a-z, A-Z, 0-9, space (" "), hyphen ("-"), underscore ("_"), dot (".") E. Defining Database Record Fields: All database record fields have a naming convention of "f??" where "f??" can range from "f1" to "f99" or more. The maximum number of database fields accepted by the system is defined by the system configuration parameter $maxfields. Except for f1 - f5, which are reserved for the system, all other fields are usable by the database owner. Whenever possible, although not essential, you should allocate and use your database fields in adjacent sequence, i.e. use f6 first, then followed by f7, f8, etc.. Definitions of f1 - f5 are as follows: f1 = "Record_Key | Access_Password" f2 = Date of Creation (yyyy/mm/dd) f3 = Date of Last Update (yyyy/mm/dd) f4 = Type of Record (Free, Standard, Enhanced) f5 = Record Status (Inactive, Active, Expired) You may set your default record type to "Standard" or "Enhanced" and the default record status to "Active" or "Inactive" during record creation. You may change these status via a specially created "Edit" template ( eg. bizdb-activate ) used only by the Webmaster. Here are some rules relating to Record Status when a record is added to the database: If the record status field "f5" is not specified, the default record status is set to "Inactive" for all record types, i.e. Free, Standard and Enhanced. You may change the default status setting to any one of the following: "Inactive", "Active" and "Expired" by using an Form Html statement in your ADD template: or [ NOTE: Use only in the EDIT template. Do not include the value="something" as the value of "f5" will be extracted from the database record by the software. ] When searching the database, you may include statements like: to your complex search template to search for only the Standard-Active records. You may use these generic field names (f??) to relate to any database fields and their contents. For example, you may use f6 to represent Company Name, and f7 for Company Address, etc.. It is important to make sure that you do not use the same name fxx to define multiple objects. Our programs will use this name to point to a unique data field in the database. For real examples, please refer to our sample Html templates that come with this System. It is also important to know that our system reserves the following input form names for holding and validating data temporarily: "pwd" - For passing input password to the CGI program. "key" and "key2" - For holding database record key. "newpwd" - For passing a new record password to the CGI program. This form parameter should only be used in the "Edit Record" template. Also see Section N. You must know how to use these names and not to change these names in your templates; otherwise you will receive fatal execution error. F. Other Parameters used by Input-Control Templates (F-1) Parameters used by Add and Edit/Delete/Show templates In the following paragraphs, "f??" could be the name of any database field ranging from f1 to f50 if $maxfields is equal to 50. 1. requireflds - Specify which of the database fields are mandatory. Example: where f6, f7 and f12 are the compulaory input fields. 2. maxleng-f?? - Define the maximum length of the field "f??". Example: Maximum input for field "f10" is limited to 1000 chars. 3. image-f?? - If you want to define "f??" as an image field, this form parameter must be set equal to "yes". Only one "image-fxx" statement could be defined in any "Add Record" or "Edit Record" form. The image must be uploaded by the "bizdb_upload.cgi" program to an image directory defined by "$upload_dir". The filename of the image will be set equal to "recordkey-dbname.image_file_ext" to ensure it has a unique name on the system. (Note: dbname will be replaced by the actual database filename) Example: where "f18" is the database field containing the filename of the uploaded image. 4. image_file_ext - Specify the filename extension of your image file as defined by image-f??. Must be either "no" or "jpg" or "gif" or "no change". If set to "no", that means no image file for this particular field "f??". If set to "no change", that means there is no change to the image stored in field "f??". Example 1: This example is for use in the ADD html template. Image Format (file extension of the image) 5. recipient - If present, the recipient will be informed if records has been added or updated. Example: This statement specifies "abc@abc.net" to be the e-mail address for receiving database addition and update acknowledgements. *************************************************************** **** The following parameter (6) is for the Search Forms **** **** searching database containing "Multiple Selection **** **** Drop-Down List" fields in the "Add Record" and **** **** "Edit Record" templates. **** 6. multiple_selections - Specifies which fields in the database file are "Multiple Selection Drop-Down List" fields. This form statement is required in any search forms (or search URLs) only if such a database field exists. Please refer to Section (N-4) for more details. Example: where fxx,fyy,fzz are the field ids of the multiple selection drop-down list fields configured in your database file. *************************************************************** 7. supervisor - To be used in conjunction with the "LoginControl" software - Set to "yes" if you want to search and display both expired and non-expired records. If the other search criteria are matched, the content of the expired records will also be displayed. This parameter is best be used in a search template specifically designed for the use of the webmaster. Example: (F-2) Parameters used by Search Criteria Templates The only input field names you can use in the search form for accepting keywords are "f4", "f5" and "keywords". We use "f4" to specify what record type is to be retrieved. We normally use a hidden form statement to specify this. Example: We use "f5" to specify what record status is to be retrieved. We normally use a hidden form statement to specify this. Example: The whole database is searched for the specified keywords. The default keyword separator is a space character. If you want to search a number of keyphrases, you may use either "++" (the OR operator) or "&&" (the AND operator) as your boolean operator. Enter 2001/06 to display all entries entered in June 2001. Example: (optional) (optional) Possible inputs: 1. enter nothing 2. art business computers 3. cnc technology++ (this is a keyphrase search) 4. internet++virtual servers++web hosting 5. internet&&Web database **** Using "Comma" as the keyword separator - a better method **** You can change the keyword separator to "comma" (,) by adding the following form statement in front or after the "keywords" form statement: The possible inputs now become: 1. enter nothing 2. art,business,computers 3. cnc technology (this is a keyphrase search) 4. internet++virtual servers++web hosting 5. internet&&Web database If you are only interested in letting users to search full words, please add the following statement to your search form: In the absence of this statement, both full and partial words in the database file will be searched. With this version of software, you cannot use Complex Search. Only Standard and Advanced version of our software can perform Complex Search ( please see our Demo Site ). Also you cannot sort the search report by a given field name. ************************** If you want to control the number of record listings to be displayed on the search result report, you can insert the following statement into your search form: Example: In the presence of this form statement, it will replace the value of $maxdispscreen defined in the "bizdb-search.cgi" script. G. How to Display Database Field Values on Edit or Search Report: (G-1) For the "Edit" template, such as "bizdb-edit", the Software uses the following methods to display the value of a database field name: (1) Whenever the program finds a string like name="f??" in the Html template, it will replace it by name="f??" value="value_in_the_DB_record". Example: will be replaced by IMPORTANT: 1. YOU MUST NOT INCLUDE THE "value=???" INTO THE INPUT STATEMENT. THE VALUE OF THE DATA FIELD WILL BE INSERTED AUTOMATICALLY BY THE SYSTEM WHEN A RECORD IS DISPLAYED. 2. ALSO MAKE SURE YOU HAVE ALL THE FIELDS DEFINED IN YOUR EDIT OR ACTIVATE TEMPLATES. FOR INSTANCE, IF YOU HAVE DEFINED 20 USER FIELDS (I.E. 'f6' - 'f25'), YOU MUST HAVE 'key2', 'f2' - 'f25' ('f2' - 'f5' ARE SYSTEM FIELDS ) DEFINED IN YOUR TEMPLATES EITHER AS , , OR