ReadMe File for the BizDB Database LoginControl Facility #################################################################### # # # LoginControl - An Add-On Facility of the BizDB Database Software # # # #################################################################### # # E-mail: cnctek@cnctek.com # # MINIMUM SERVER REQUIREMENTS: # # Runs on any Unix or Linux Operating System; Provides full FTP access; # Supports Perl and cgi-bin; Allows creation of files and # directories by cgi programs; Needs BizDB already installed. # # # COPYRIGHT NOTICE # All BizDB products are products 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 indivituals, companies and organizations. # # DISCLAIMER: # # All software and templates 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. IMPORTANT NOTE: This web-based "LoginControl" software is an add-on facility of our BizDB Database Package. Before installing and using this facility, you must have our BizDB database system installed on your server. Through your BizDB installation, you have demonstrated that you are able to add, update, delete, search and display BizDB database records. You should have no problems to setup BizDB database fields and the associated Html templates. >>> ARE YOU RUNNING THE MOST RECENT RELEASE OF BIZDB? READ CAREFULLY BEFORE <<< >>> ARE YOU RUNNING THE MOST RECENT RELEASE OF BIZDB? READ CAREFULLY BEFORE <<< >>> ARE YOU RUNNING THE MOST RECENT RELEASE OF BIZDB? READ CAREFULLY BEFORE <<< This software only works properly on the BizDB versions released after Sept 15, 2004. Please download our latest version via http://www.cnctek.com/bizdb-html/ . * * * * * * * * * * * * * WARNING: The skills required to implement this add on feature is rated by us as "High". If you have completed the installation of our BizDB software yourself before, you should have no problem to understand our documentation and install our package. Otherwise, we don't recommend you to install this software yourself. * * * * * * * * * * * * * IF YOU WANT TO ACCEPT ONLINE PAYMENT FOR YOUR DATABASE RECORDS, YOU WILL HAVE TO SUBSCRIBE TO THE SERVICE OF A MERCHANT ACCOUNT PROVIDER SEPARATELY. YOU MUST MAKE SURE THAT AS SOON AS THE PAYMENT TRANSACTION IS COMPLETED, YOUR PAYMENT (MERCHANT ACCOUNT) SERVER CAN RETURN THE CONTROL TO A "RETURN-URL" WHICH CAN BE SPECIFIED BY YOU IN THE PAYMENT / ORDER REQUEST FORM LOCATED ON YOUR SERVER. * * * * * * * * * * * * * (You can test and order BizDB directly from our Website located at http://www.cnctek.com/bizdb-html/ . Thank you.) ################################################################## TABLE OF CONTENTS: A. Contents of our ZIP file B. Features provided by the "LoginControl" package C. System Configuration Parameters in the CGI Scripts D. How to setup the "New Member Registration" and "Member Update" Html Template E. How to setup the "Member Login" Html Template F. How to setup the "Member Area" Html Template G. How to offer search functions for "Registered" members only H. How to setup the "Member Logout" Html interface I. Recommended "Navigation Bar" for the various BizDB templates J. How to set the default expiry date for new listings K. How to extend the expiry date of an existing listing (membership renewal) L. How to send reminder email to members who are about to expire M. How to administer member database by the Webmaster N. How to delete a batch of expired records O. Installation Procedures P. How to support multiple record types (Free, Standard, Enhanced) Q. How to bill users for "Fee-For-Posting" listings ################################################################## A. Contents of our ZIP file After decompressing the ZIP file by WinZIP/Win 95/98/2000, you should find the following files: (1) login.cgi - CGI script used for logging the user into (program) the specified BizDB database using the username and password entered on the "Member Login" page. (2) login_check.cgi - CGI script used for checking if the user (program) who are trying to access the "Member Area" page has already been logged in to the database system. If the user has not yet been logged in to the system, he will be directed to the "Member Login" page. (3) display.cgi - CGI script used for displaying a Web page (program) or a file stored in a protected directory which is accessible to registered members only. (See Section F) (4) logout.cgi - CGI script used for logging the user out (program) from the current BizDB database. (5) ordered.cgi - CGI script used for activating the (program) specified database record after a payment was made successfully. The expiry date of the record will also be extended automatically to cover the system defined renewal period. This program is normally activated by a "Return_URL" which was passed from the "Member Renewal" page resided in your BizDB database server to your merchant account server along with the payment and credit card information (this is required for a paid service) and then passed back to your BizDB database server for member record activation. For an example of the "Return_URL", please see the "renewal-standard.tmpl" template. (6) reminder.cgi - CGI script used for finding out all the BizDB database records which are expired or about to expire (based on the expiry date stored on each record). This program will also send a "Renewal Reminder" e-mail to each of those record owners (members) to remind them to renew their memberships. (7) login.tmpl - This is the sample "Member Login" Html (template) template. All users must login to access the BizDB database through this page. (8) member-area.tmpl - This is the sample "Member Area" Html (template) template. Users will be directed to this page as soon as their "Login" requests are accepted. In this page, each user will be able to "Update" and "Delete" his own record, "Search" the "members-only" BizDB database records, as well as to display and view the Web pages stored in a protected directory which is commonly available to all registered members. You can also include links to allow your users to access other 3rd-party software applications via this page. (9) renewal-standard.tmpl (template) - This is the sample "Member Renewal" Html template for "Standard" record type. All unregistered and expired users (they are detected during the "Login" process) of the "Standard" record type will be directed to this "Renewal" page. In this page, the user will be asked to pay a fee to extend his current member (or listing) status for another xx days which can be defined in the "ordered.cgi" cgi script. (10) reminder.html - The sample "Generate Renewal Reminder E-mails" Html Web page. (Currently stored in the /admin directory.) (For use by your Webmaster only) (11) reminder.txt - This file contains the sample message to be (template) inserted to the "Renewal Reminder" e-mail. (12) register.tmpl - The sample Add DB record Html template. (Record type within the form is set to "Standard") (For use by your members or Web site visitors) (13) edit-standard.tmpl - The sample "Edit/Delete/Show database record" Html template developed for "Standard" record type. (For use by your members or Web site visitors) (14) search.html - The sample Search database Web page. (For use by your members or Web site visitors) (15) report.tmpl - The sample database Search Report Html template. (For use by your members or Web site visitors) (16) detail.tmpl - This sample Html template is used to report the details of a given record. (For use by your members or Web site visitors) (17) batchdelete.tmpl - The sample "Delete Database Records In Batch" Html template. (For use by your Webmaster only) (18) 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. (For use by the person submitting the database record) (19) webmaster-search.html - The sample Search database Web page. (Currently stored in the /admin directory.) (For use by your Webmaster only) (20) webmaster-edit.tmpl - The sample Edit/Delete/Show database record Html template. (For use by your Webmaster only) (21) webmaster-report.tmpl - The sample database Search Report Html template. (For use by your Webmaster only) (22) webmaster-detail.tmpl - This sample Html template is used to report the details of a given record. (For use by your Webmaster only) (23) pencilbullet.gif (image) - This is the bullet image used in the sample "Member Area" template (member-area.tmpl). (24) index.html - Currently stored in the "/protected" directory. page1.html These are sample Web pages to be installed in page2.html the "protected" directory. Important Points to Note: ========================= (1) The sample Html templates includes in this package are for training purpose only. You have to setup your own templates to support your specific requirements. (2) The "bizdb-aed.cgi", "bizdb-search.cgi" and "bizdb_upload.cgi" programs referenced in this documentation and in some of our Web pages and Html templates are not included in this add-on package. You can find them in the BizDB package which you should have purchased earlier. 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. Features provided by the "LoginControl" package Our "LoginControl" software provides a number of valuable add-on features for the BizDB software. These features include: (1) Login Control - Allows the user to login to the member area using his user id (record ID/number) and password. Once logging into the member area, the user will be able to: (a) update his own record / listing, (b) delete his own record / listing, (c) search listings in the BizDB database which is available to members only, and (d) view Web pages which are stored in a protected directory which is supposed to be accessible to registered members only. (2) Logout Control - Allows the user to logout from his member area. (3) Listing Renewal - Allows any expired or to-be-expired member to renew his own record listing. ** The use of this feature is optional. ** (4) Renewal Reminder - Allows the Webmaster to send reminder emails to members whose listings are about to expire. ** The use of this feature is optional. ** Conditions of Use: ================== - (1) and (2) are to be used together. - You don't have to use (3) and (4) if you don't want to. - If you use (3), you have the choice to use or not to use (4). - If you don't use (3), you can't use (4). - If you use (4), you must reserve a field in each of the database records to store the user's e-mail address. The "renewal Reminder" will be sent to this e-mail address. C. System Configuration Parameters in the CGI Scripts Please make sure you have the following parameters in the various cgi scripts included in this package configured properly before uploading them to the CGI-BIN directory. Parameter Name Where Description ============== ===== =========== (1) $login_ctl bizdb-aed.cgi Login Control. If you want to provide a "Login" procedure for your database members, you must set this variable to "yes". This forces all members to "Login" to the member area before they can access the BizDB databases. (2) $charset login.cgi Define the character set to logout.cgi be used by your database software login_check.cgi and Html templates. This is ordered.cgi required for some foreign reminder.cgi languages. (See BizDB readme.txt) display.cgi (3) $superpwd login.cgi Supervisor password. Using this login_check.cgi password, the Webmaster has ordered.cgi absolute authority to update reminder.cgi and delete any member record. (4) $maxfields ordered.cgi Maximum number of DB Fields. The setting here must be identical to that used in the bizdb-aed.cgi script. (5) $database_dir login.cgi Full pathname of the directory reminder.cgi in which your database is stored. If possible, location of your database file should be stored outside the Html directories. (6) $template_dir login.cgi Full pathname of the directory reminder.cgi in which all Html templates are stored. (7) $expiryDate_fld bizdb-aed.cgi Member records can be set to login.cgi expire after xx days. This ordered.cgi variable defines which field reminder.cgi number in the database will store the record expiry date. The setting of this field must be identical to that used in the "bizdb-aed.cgi" script of your BizDB software. (8) $expiry_period bizdb-aed.cgi The expiry date of a newly login.cgi submitted record will be set to today's date PLUS the xx days defined by $expiry_period. The setting of this field must be identical to that used in the "bizdb-aed.cgi" script of your BizDB software. (9) $payment_period ordered.cgi Length of the payment period in days. Must be set to the same value as $expiry_period . (10)$standard_renewal_url This URL directs the user to $enhanced_renewal_url an "Order/Renewal" page if his login.cgi record has been expired. login_check.cgi (See Section K) *** Will be applicable only when $expiryDate_fld is not empty *** NOTE: The **userid** tag in the order/renewal page will be replaced by the user's userid (Record ID). (11)$free_edit_template login.cgi Each of these variables defines the login_check.cgi filename of the "Edit" html template $standard_edit_template of a specific record type. $enhanced_edit_template (See Section F) (12)$reminderDate_fld ordered.cgi Member records can be set to reminder.cgi expire after xx days. This variable defines which field number in the database will store the payment reminder date. (13)$reminder_period ordered.cgi Days after which (calculated from the beginning of the the payment period) the reminder e-mail will be generated to the database member. (14)@dbname_fns reminder.cgi This array defines all the database filenames used in your BizDB database system. Ex1: @dbname=('file1'); Ex2: @dbname=('file1','file2','file3'); (15)$reminder_msg_fn reminder.cgi Filename of the text file storing the content of the Reminder E-mail message. (16)$send_reminder_every_x_days This variable tells the software to reminder.cgi generate a reminder email to each expired or to-be-expired user once every x days until the user record is renewed or deleted. (17)$stop_reminder_after_x_days This variable tells the software when reminder.cgi to stop generation of the reminder emails to the expired or to-be-expired users. (18)$email_fld reminder.cgi Field number of the BizDB Member Database storing the member's e-mail address. This is the e-mail address to receive the "Renewal reminder" message if configured. (19)$webmaster ordered.cgi Webmaster email address reminder.cgi (to be included in the user notification e-mails) (20)$mailprog ordered.cgi Full pathname of the "sendmail" reminder.cgi program. You need "sendmail" to send user notification emails. (21)$delimitor login.cgi Field delimitor. ordered.cgi The setting here must be identical reminder.cgi to that used in the bizdb-aed.cgi script. (22)$uid_pwd_sep login.cgi Used in field-1 (f1) for ordered.cgi separating the UserID(RecordID) reminder.cgi from the password. The setting here must be identical to that used in the bizdb-aed.cgi script. (23)$login_request_url login_check.cgi The URL to activate the "login.cgi" display.cgi script to display the "User Login" page on the browser screen. Specify the url location of the "login.cgi" script followed by a "?", then followed by the filename of the "login" template located in the template directory. (24)$return_url login.cgi Return URL link used by OK and logout.cgi error messages. login_check.cgi display.cgi (25)@valid login.cgi These are the urls (separated logout.cgi by comma) that are allowed to execute this database system. This prevents any of our programs to be accessed by unauthorized Websites. ******************************************* PARAMETERS CHECKLIST: login.cgi - $charset, $superpwd, $database_dir, $template_dir, $expiryDate_fld, $expiry_period, $standard_renewal_url, $enhanced_renewal_url, $free_edit_template, $standard_edit_template, $enhanced_edit_template, @valid, $delimitor, $uid_pwd_sep, $return_url logout.cgi - $charset, $return_url, @valid login_check.cgi - $charset, $superpwd, $template_dir, $standard_renewal_url, $enhanced_renewal_url, $free_edit_template, $standard_edit_template, $enhanced_edit_template, $login_request_url, $return_url display.cgi - $charset, $protected_dir, $login_request_url, $return_url ordered.cgi - $charset, $database_dir, $maxfields, $superpwd, $expiryDate_fld, $payment_period, $reminderDate_fld, $reminder_period, $webmaster, $mailprog, $return_url, $delimitor, $uid_pwd_sep reminder.cgi - $charset, $superpwd, $database_dir, $template_dir, @dbname_fns, $expiryDate_fld, $reminderDate_fld, $reminder_msg_fn, $email_fld, $send_reminder_every_x_days, $stop_reminder_after_x_days, $return_url, $webmaster, $mailprog, $delimitor, $uid_pwd_sep D. How to setup the "New Member Registration" and "Member Update" Html Template PURPOSE: You should use this Web page to invite interested people to list in your member database. Only authorized members (with an "Active" status in their database records) will be allowed to login to your system to use the various database functions offered in the member area. ==> Our sample "Member Registration" Html template is "register.tmpl". The procedure of designing this template is exactly the same as that used in designing the "Add Database Record" Html template. Please refer to Section C-1 ( How to use Input-Control Templates to call CGI programs ) of the BizDB ReadMe.txt file. *************************************** NOTE 1: Before uploading the "register.tmpl" template to your server, you have to add one more statement (see example below) to your ADD NEW RECORD FORM if you choose to store the expiry date in the member records (i.e. $expiryDate_fld in the "bizdb-aed.cgi" script is not empty). - Please replace "any_number" by any number between 0 and 99999. The system will use this number to calculate the record expiry date. - If 0 is used, the member record will be expired immediately. - If 1 is used, the member record will be expired tomorrow. - If 10 is used, the member record will be expired after 10 days from today. - Replace "fxx_expiry_date_field" by the database field number configured to store the record expiry date, eg f20 (Also see Sections J and L). - Replace "fxx_reminder_date_field" by the database field number configured to store the reminder date, eg f19 . - Make sure your $maxfields variable in both "bizdb-aed.cgi" and "bizdb-search.cgi" are large enough to accommodate the 2 new "expiry date" and "reminder date" fields. Example: The value of the "expiry_period" in the "Registration Form" above could be smaller or greater than the value of $expiry_period defined in the "bizdb-aed.cgi" script. In the presence of this statement in the "Registration Form", the "bizdb-aed.cgi" script will use this value instead of the value defined in the script itself. This enables the Webmaster to allocate a "trial" (free test) period for any new members. *************************************** NOTE 2: In this template, you won't find any link linking the user to the "Member Renewal / Order" page. This is because our software will automatically direct the user to the "Renewal / Order" page if the user was detected as "inactive" or already "expired" during the "Logon" process. *************************************** NOTE 3: You would also need to modify your current BizDB "EDIT" Html template (here I assumed that you have already setup a working version of BizDB database using our original BizDB software) to include 2 new statements if you choose to store expiry and reminder dates in the member records (i.e. $expiryDate_fld in the "bizdb-aed.cgi" script is not empty). Example: Also there is no need to include the "dbname" and "key2" FORM statements in your "EDIT Record" template. If you have the following FORM statements in your current BizDB "EDIT" template, please remove them: Remove Remove This is because the information for these 2 variables have already been obtained from the "Member Login" screen. E. How to setup the "Member Login" Html Template PURPOSE: Allows only authorized users to execute the database software's EDIT, DELETE and SEARCH functions. First of all, the userid and password of the user will be validated by our "login.cgi" program. If approved, the user will be directed to a member area where the user will be allowed to update his own record information, delete his record, as well as to search and display other member records. ==> Our sample "Member Login" Html template is "login.tmpl". In the "login.tmpl" template, you can find the following FORM statements:
User Id:
Password:
You must include the same number of FORM statements into your own login template. Make sure to adjust the values of the following FORM parameters in your login template to meet the needs of your database setup: - method="post" action="url-of-cgi-directory/login.cgi" - name="template" value="your-member-area-html-template" - name="dbname" value="your-database-filename" This rule also applies to all other Html templates mentioned in the rest of this documentation. * * * * * * * * * * * * * * * * * * * * * * For BizDB database containing multiple database files, please replace: by: Your member must select a database file in which his record is resided and then enter his user id and password to login to his member area. F. How to setup the "Member Area" Html Template PURPOSE: Allows the "login.cgi" script to display this page on the browser screen as soon as a user is successfully logged in to the system. ==> Our sample "Member Area" Html template is "member-area.tmpl". In the "member-area.tmpl" template, you can find the following links: (1) Update or Delete Your existing Record (Listing) Update or Delete Your Current Record ** IMPORTANT NOTES **: (A) There is no need to specify the "key2", "pwd" and "dbname" parameters as they are already saved by the system during "Member Login" and will be retrieved for updating purpose. (B) You must setup the following variables defined in the "login.cgi" script properly: => If you run only one type of listings in the database, you must => specify the filename of the "Edit Record Template" that match => the record type defined in "f4". => If you run multiple types of listings in the database, then for => each type you must specify the filename of its "Edit Record" => template as follows: Any **template** tag found in your "Member Area" template will be replaced by the corresponding filename of the "Edit Record" template (depending on the record or listing type of the member) defined in the following variables: $free_edit_template = "edit-free.tmpl"; # For "Free" record type $standard_edit_template = "edit-standard.tmpl"; # For "Standard" record type $enhanced_edit_template = "edit-enhanced.tmpl"; # For "Enhanced" record type (2) Search Your Member Database (Member Listings) Search Member Database You can also use the following link if the search page is stored in the template directory as "search.tmpl". Search Member Database WHERE: (a) "url-of-cgi-directory" is the url of your cgi directory containing the "bizdb-search.cgi" script. (b) "url-of-html-directory" is the url of your html directory containing the "search.html" Web page. **IMPORTANT NOTE**: You can setup your "bizdb-search.cgi" program to allow only those users who have registered and logged in to the system to search your member database. Please read "Section G" below for details. (3) Access Web Pages or Files Stored In A Password-Protected Directory You may allow your registered members to access/display Web pages or files stored in a directory which is not available to general users (non registered users). The directory could be password-protected through a administrative facility provided by your server. The URL link to display a file in a undisclosed or password-protected directory must be in the form of: Display a file only available to registered members WHERE: (a) "url-of-cgi-directory" is the url of your cgi directory containing the "display.cgi" script. (b) "display.cgi" must be properly configured in your cgi directory. The Web pages or files stored in the protected directory (defined by $protected_dir) will be accessible to all registered members. (c) "valid_filename" must be a valid Web page, text or binary filename such as index.html, index.shtml, page1.html, page_2.html, text_file.txt, image1.gif, image2.jpg, document.pdf, compressed.zip, etc.. **IMPORTANT NOTE**: (1) Never display files stored in the protected directory with a normal URL such as http://www.yourdomain.com/bizdb-members/protected/page1.html . This will disclose the Web address of your protected directory. (2) If possible, password protect your "Protected" directory with a supervisor username and password so that nobody could view these pages without going through the "display.cgi?..." link. (4) Extend Membership Expiry Date Via Online Payment (for fee-for-listing records) You may set up a online payment link on your Member Area template to allow your user to extend his membership expiry date if he wants to. After payment, his membership status will also be changed back to "Active" so that his record will become searchable by all other users on the Internet again. The URL link to order an extension of the mebership expiry date must be: - For Standard Record Type: - For Enhanced Record Type: NOTE 1: Also read Section P - How to support multiple record types (Free, Standard, Enhanced) NOTE 2: The tag **expirydate** will be replaced by the record's expiry date if $expiryDate_fld is configured. G. How to offer search functions for "Registered" members only ==> Our sample "Search Database" Web page is "search.html". Our search engine software offers you the flexibility to decide whether you want to allow your member database to be searched and viewed by all surfers or just the users who are login'ed to your system. This is especially true when you are running a "Pay for View" database. If you have a "Pay for View" database, please insert the following FORM statement into each of your search forms: Example:

This enables the "bizdb-search.cgi" script to make sure that only the "logged in" users can search your database. Search requests from all other users will be rejected. If a search request URL is used, you should insert the "mbr_only=yes" text into the URL as follows: Display New Entries Show Internet Companies Please compare these 2 URLs with the following URLs which allow all users to search and display your database details (i.e. no "login" checking required): Display New Entries Show Internet Companies Other than the above changes, please follow the standard procedures documented in the "ReadMe.txt" file of BizDB to design your "Search & Report database" templates. H. How to setup the "Member Logout" Html interface PURPOSE: To allow a currently login'ed user to "Logout" from the member area. After logging out from the system, the user will no longer be allowed to access his member record unless he logins again through the "Member Login" page. Logout Html code: Logout where "url-of-cgi-directory" is the url of your cgi directory containing the "logout.cgi" script. I. Recommended "Navigation Bar" for the various BizDB templates We recommend to insert a simple "Text Navigation Bar" into each of your Html templates to help users (visitors) navigating your member database easily. The links in the navigation bar could provide the following functions: (1) Register as a new Member - This is the place where a new user (that means a new record containing the userid and password) is registered to the database system. Submit / Register (2) Member Area - If the user has already been logged in to the system, this link will send him directly to the member area. Otherwise, the user will be directed to the "Member Login" page. Login / Member Area Please note that in this URL, we are using the "login_check.cgi" script. In the "login_check.cgi" script, we use the variable "$login_request_url" to define the URL of the "Member Login" page. $login_request_url = "/url-of-cgi-directory/login.cgi?login.tmpl"; (3) Logout - Logout the user from the member area. Logout (4) Lost Password - Link the user to the "Lost Password" page. Through the "Lost Password" page, the user can request the system to retrieve the User ID's and Password's of all database records containing his input e-mail address. Lost Password (5) Search Database - Link the user to the "Search Database" page. Search You can also use the following link if the search page (search.tmpl) is stored in the template directory: Search *** Don't forget to insert into your search forms if you only allow authorized members to search your database. See "Section G". *** WHERE: (a) "url-of-cgi-directory" is the url of your cgi directory containing the associated cgi scripts. (b) "url-of-html-directory" is the url of your html directory containing the associated Web pages. J. How to set the default expiry date for new listings Our software provides an optional feature to calculate and store the expiry date on each of the newly generated database records. If you want to turn this feature on, you must define the following variables in the "bizdb-aed.cgi" script properly: (1) $expiryDate_fld - 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 record expiry date. Set this variable to "" if this feature is not used. (2) $expiry_period - The expiry date of a newly submitted record will be set equal to today's date plus xx days defined by this variable. If you don't want to expire a record, then set this variable to 99999 days (this is equivalent to 277 years). You must define this variable if $expiryDate_fld is not empty (""). This variable will be ignored if the expiry feature is not used. Example 1: Field # 20 stores the record expiry date. All records will be expired after 365 days. $expiryDate_fld = "f20"; $expiry_period = "365"; Example 2: All records in the database will never expire. $expiryDate_fld = ""; $expiry_period = ""; K. How to extend the expiry date of an existing listing (membership renewal) K-1. Automatic Detection Of Membership Renewal When a registered user logins to the system via the "Member Login" page, the "login.cgi" script will check the user record's expiry date. If the expiry date is older than today's date, the system will direct the user to a specific URL defined by the following variables in the "login.cgi" script: $standard_renewal_url - used for "Standard" record type (defined in "f4") $enhanced_renewal_url - used for "Enhanced" record type (defined in "f4") The $xxxx_renewal_url must be defined as: $xxxx_renewal_url = "/url-of-cgi-directory/login.cgi?template=renewal_template_filename&dbname=$in{'dbname'}&userid=$in{'userid'}&action=showblank"; WHERE: (a) xxxx is either "standard" or "enhanced" depending on the record type. (b) "url-of-cgi-directory" is to be replaced by the url of your cgi directory containing the "login.cgi" script. (c) "renewal_template_filename" is to be replaced by the filename of the Member Renewal page you are using. We have provided a sample member renewal page for you. Its filename is "renewal-standard.tmpl". Examples: 1. For "Standard" record type: $standard_renewal_url = "/cgi-bin/bizdb-members/login.cgi?template=renewal-standard.tmpl&dbname=$in{'dbname'}&userid=$in{'userid'}&action=showblank"; 2. For "Enhanced" record type: $enhanced_renewal_url = "/cgi-bin/bizdb-members/login.cgi?template=renewal-enhanced.tmpl&dbname=$in{'dbname'}&userid=$in{'userid'}&action=showblank"; ***NOTE*** For Free record type, no "renewal_url" definition is required. If a free record expires, the user must register as a new member if he wants to access the database again. If you can't find these variable names in your "login.cgi" script, please contact us to download a latest release. Please make sure your listing type ("f4") is set to one of the following: - Free (Free here means free for the period defined by "expiry_period") - Standard - Enhanced If you only have one type of records in your database and you intend to charge users for a fee for a given period, please set it to "Standard". If you want to support multiple record types (up to 3 maximum) with each type charging a different fee, you must setup a different set of "Add Record", "Edit Record" and "Renewal" templates for each of these types. Sample "Login" Web Page Template Provided: "login.tmpl" Example: ...... ......
...... User Id
Password

......

...... *** NOTE *** The value of the "action" form statement must be set to "login". K-2. Informed Membership Renewal When a user is informed by an e-mail generated by our "reminder.cgi" program for membership renewal, the process is known as the "Informed Membership Renewal". For details of finding and sending "Reminder E-mails" to members who are about to expire, please read Section L of this manual. The form used by the user to login to renew his/her membership is as follows: Example: ...... ......
...... User Id
Password

......

...... *** NOTE *** 1. The value of the "action" form statement must be set to "renew". 2. The "template" form statement is not required. 3. The easiest way to prepare this "Login to Renew" Web page is to copy the "login.tmpl" template to a new file called "login_to_renew.html", remove the "template" form statement, and then change the value of the "action" form statement from "login" to "renew". Finally, change the title of this Web page and then copy it to your Html directory. ****************************************************** The content of the "Renewal" template (eg "renewal-standard.tmpl", referenced by the variable "$standard_renewal_url" in "login.cgi", stored in the templates directory) must contain an Online Payment Form. Depending on the requirements of your 3rd-party Merchant Account Server, the payment form could contain all the product information (product or service code, description, price, quantity, etc.) plus some fields to identify the "Buyer". Example of the Order / Payment Form:
Name:
E-mail Address:
Once the "Order" button is pressed, control will be passed to your 3rd-party Merchant Account Server. Based on your request, the Remote Merchant Account Server will try to complete the payment transaction. At this point, it is essential that the Remote Merchant Account Server should be able to return control to your original Database Server as soon as the transaction is successfully processed. The URL to be returned to (in our case it is a cgi script called "ordered.cgi") is defined by the hidden "return_url" form statement (you may need to change the "return_url" to a different name as suggested by your Remote Merchant Account Server) as illustrated in the example above. ************************************************** More about the content of the "return_url": It is essential that the user's UserID (Record ID) and the filename of the member database are passed correctly to the "ordered.cgi" script so that the user record can be activated (the record status in "f5" will be set to "Active" by the "ordered.cgi" script automatically) and its expiry date can be extended. Please make sure that, in the "return_url" value clause above, you can only replace the "url-of-cgi-directory" by the url of your cgi directory containing the "ordered.cgi" cgi script. You must not change all other parameters. The whole of 'ordered.cgi?M_dbname=**dbname**&M_userid=**userid**' (case sensitive) must not be changed. NOTE: The proper functioning of your Remote Merchant Account Server is not the responsibility of our software. Please do comprehensive testings yourself to make sure the record expiry date is updated properly. L. How to send reminder e-mail to members who are about to expire This process involves 2 setup steps (required during installation only): SETUP STEP 1 ============ Our software provides an optional feature to calculate and store the "Renewal Reminder" date on each of the newly generated database records. If you want to turn this feature on, you must define the following variables in the "ordered.cgi" script and "reminder.cgi" script properly: (1) $expiryDate_fld - 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 field to "" if this feature is not used. (2) $reminderDate_fld - This variable defines which field number in the database will store the renewal / payment reminder date. Set this to f19 if field number 19 is used to store the reminder date. Set this field to "" if this feature is not used. (3) $reminder_period - The "ordered.cgi" program will use the value stored in this variable to calculate the date after which "Renewal Reminder" e-mails could be generated to the expired or to-be-expired user. The value should be 7-30 days less than the payment period ($payment_period). (4) $send_reminder_every_x_days - This variable instructs the reminder.cgi program to generate and send a reminder email to the expired or to-be-expired user once every x days until the user record is renewed or deleted. Note : Setting of $send_reminder_every_x_days to "" or "0" will bypass the checking of the parameter, which means a reminder email will always be generated to the expired or to-be-expired user everytime when the reminder.cgi program is executed. (5) $stop_reminder_after_x_days - This variable instructs the reminder.cgi program to stop sending reminder emails to the expired or to-be-expired user after x days has gone from the configured record reminder date. Note : Setting of $stop_reminder_after_x_days to "" or "0" will bypass the checking of the parameter. Example 1: Field # 19 stores the record renewal reminder date. All records will be expired after 365 days. Field # 20 stores the record expiry date. $expiryDate_fld = "f20"; $reminderDate_fld = "f19"; $reminder_period = "350"; Example 2: Turn off the "Renewal Reminder" feature. As a result, no reminder emails will be generated to the user. This affects all records in the database. $reminderDate_fld = ""; $reminder_period = ""; Example 3: If $send_reminder_every_x_days = "5", a reminder email will be be generated to the expired or to-be-expired user once every 5 days. $send_reminder_every_x_days = "5"; Example 4: If $stop_reminder_after_x_days = "50", no reminder email will be sent to the expired or to-be-expired user after 50 days has gone from the record reminder date. $stop_reminder_after_x_days = "50"; To install the "ordered.cgi" script, please follow the procedures in "Section O" below. SETUP STEP 2 ============ Execute this step only if STEP 1 is configured. The cgi script involved is "reminder.cgi". To install this script, please configure all the variables defined in this script. See "Section C" above. *** Major variables: @dbname_fns, $expiryDate_fld, $reminderDate_fld, $reminder_msg_fn, $send_reminder_every_x_days, $stop_reminder_after_x_days, $email_fld, $webmaster, $mailprog, $database_dir, $template_dir, $delimitor, $uid_pwd_sep To install the "reminder.cgi" script, please follow the procedures in "Section O" below. Now modify the "reminder.txt" file to include the reminder message to meet your business needs. (Any occurrence of the **key** tag in the reminder message will be replaced by the record id of the record. The **expirydate** tag will be replaced by the expiry date of the record.) Upload the "reminder.txt" file to the "templates" directory on your server (see Section O). ******************************************************* Once your programs are fully installed and your databases are ready for testing, you can generate some test records (with known expiry and reminder dates on those records) and then execute the "reminder.cgi" program via your Secured Database Administration Web Page. ==> Our sample "Generate and Send E-mail Reminders" Web page is "reminder.html". For security reasons, we strongly recommend that you copy this Html file to a password-protected directory, such as "admin". You can call up this page using: http://www.yourdomainname/admin/reminder.html You may execute this reminder program once a day / week / month using crontab or your Web browser interface. M. How to administer member database by the Webmaster Purpose: To allow the Webmaster to search, delete and change the contents of any member records of interest. The Webmaster could also change manually the expiry date and reminder date of the records. ==> Our sample "Webmaster" Web page is: - "webmaster-search.html" - for searching the member database ==> Our sample "Webmaster" Html template are: - "webmaster-edit.html" - for displaying a specific member record - "webmaster-report.html" - for reporting the search result - "webmaster-detail.html" - for displaying the details of a member record For security reasons, we strongly recommend that you copy the "webmaster-search.html" file to a password-protected directory, such as "admin". You can call up this page using: http://www.yourdomainname/admin/webmaster-search.html As soon as the search page is displayed, you can search and edit any member records you like. NOTE: The execution of the search, edit and delete functions in these templates does not require the "Login Control" (i,e. Member Login) capability. This enables the Webmaster to check and manipulate the member database easily. The design of the "Webmaster" templates will follow the same way as designing the standard BizDB templates. Please refer to the "ReadMe.txt" file of your BizDB software for detailed procedures. During record update (please refer to our sample "webmaster-edit.tmpl" template), the Webmaster has first to enter a valid record id to display the record and then enter the record password together with the new contents to initiate the record update. On both "webmaster-edit.tmpl" and "webmaster-detail" templates, we have included additional Html codes to display the content of the record expiry and reminder dates. To update the "expiry date" or "reminder date" manually, you must use the date format as dd/mm/yyyy, i.e. 30/04/2001 . N. How to delete a batch of expired records In our sample templates, we have attached a file called "batchdelete.tmpl" containing the necessary FORM statements to delete a batch of database records. Please test it first and use it with care. With the use of the "useexpirydate" statement, you can specify whether you want to delete only those records whose expiry dates are within the date range specified in the BATCHDELETE request FORM. Example 1: All records whose creation dates ("f2") fall within the specified "Start" and "End" dates are to be deleted. Example 2: All records whose "expiry dates" fall within the specified "Start" and "End" dates are to be deleted. Example 3: You can also request the system to delete records of certain status stored in field #5 (i.e. "f5"). Example 4: This example shows all the form statements used in the "batchdelete.tmpl" template:
If "useexpirydate" = "yes" and "startday" = "01" and "startmonth" = "01" and "startyear" = "2001" and "endday" = "31" and "endmonth" = "01" and "endyear" = "2001" and "f5" = "Active" then the system will delete all those records which have the following conditions matched: (1) the expiry date (stored in the field defined by $expiryDate_fld in the "bizdb-aed.cgi" script) of the record falls within the start and end dates specified in the input FORM; (2) the status of the record ("f5") is stored as "Active". O. Installation Procedures (O-1) Decompress the 32 bit LoginControl ZIP file using 32 bit WinZIP ( available from http://www.shareware.com/ ). (O-2) Read all sections in this LoginControl-readme.txt file very carefully. Do not change the contents of the cgi codes unless you have created a backup version. (O-3) If you are implementing a "Logon Control" feature for your production BizDB system, you must backup all the cgi scripts, templates, Html files and database files of your system first. This ensures that you can fallback to your original system anytime you want. (We bears NO responsibility for any sort of software and data corruptions during the upgrade process.) (O-4) In order to explain the installation clearly, we have assumed the following directory structures for your BizDB and LoginControl system: Example Setup Only: =================== /base_dir/ --> Full directory pathname, relative to the ROOT directory of your server /base_dir/bizdb/ --> stores your current database files --> see the Installation Procedures section of your BizDB "ReadMe.txt" file for details. /base_dir/cgi-bin/ --> stores your current BizDB cgi scripts --> copy all your "LoginControl" cgi scripts to this directory --> chmod 0755 login.cgi etc.. until all new scripts are done /base_dir/html/ --> Base Html directory storing Web Pages of your site --> you may store some of your BizDB Html pages here --> you may store some of your "LoginControl" Html pages here /base_dir/html/bizdb/ --> stores your current BizDB Html templates --> copy all your "LoginControl" Html Templates to this directory --> also upload the reminder.txt file to this directory /base_dir/html/bizdb/upload-img/ --> Stores all user uploaded images used by the BizDB database. Your site configurations could be substantially different from the above. If you have problems in installing our Software on your site, please contact us. We can provide technical assistance at affordable cost. (O-5) Create on your server any necessary directories/subdirectories for storing the database files and HTML templates. This can be done via Telnet or FTP. If all such directories are already created during the BizDB installation, you can ignore this step. For example, you can store your HTML templates ( or all sample HTML templates that come with this package ) on a directory called "bizdb" created under your main Html directory. (O-6) Make sure all pathnames, URL references, navigation links and the input output control parameters used in the Html files and new templates are correct such that they will work on your Web environment. Copy all the new Html page files and Html templates into the correct HTML Directories. This can be done via the FTP. (When uploading files to your server, use ASCII transfer mode for cgi scripts, Html and text files, and binary transfer mode for image and sound files.) (O-7) Adjust all system configuration parameters on the cgi scripts (i.e. login.cgi, login_check.cgi, logout.cgi, ordered.cgi, reminder.cgi, etc.) that comes with this software so that they are matching your server and database environments. (All changes must be done using a text editor.) (O-8) You must also adjust the values of $login_ctl, $expiryDate_fld and $expiry_period in your current "bizdb-aed.cgi" script to support the new "Login Control" feature. ( This must be done carefully. All changes must be done using a text editor.) (O-9) Upload all the cgi scripts files to the cgi-bin directory of your server. Use chmod Unix command to change their access modes to 0755, i.e. rwxr_xr_x . This can be done via the Telnet or FTP. Example: cd /cgi-bin ( some servers use a different name ) chmod 0755 bizdb-aed.cgi chmod 0755 bizdb-search.cgi chmod 0755 login.cgi chmod 0755 login_check.cgi chmod 0755 logout.cgi chmod 0755 ordered.cgi chmod 0755 reminder.cgi (O-10) Connect to the Internet and open a Web browser to execute and test new functions. (O-11) If you want to execute "reminder.cgi" daily (only if you want to send reminder e-mail messages to the expired users), you have two choices. The 1st choice is to execute it manually on the browser using the URL: http://url-of-cgi-directory/reminder.cgi?pwd=yoursupervisorpassword The 2nd choice is to register this script to crontab (check with your Web hosting company to find out if this feature is supported on your server) and then have the server execute it for you daily automatically, preferrably on the start of a new day (eg. hh:mm = 00:05). Standard crontab command line: minute(0-59) hour(0-23) day-of-month month day-of-week(0-6) absolute-pathname-of-cgi-script Example: The crontab command to execute "reminder.cgi": 5 0 * * * /YourAbsoluteCgiDirectoryPathname/reminder.cgi Note: Do not include "?pwd=YourSupervisorPassword" after "reminder.cgi". This example will execute "reminder.cgi" at 00:05 of each day. P. How to support multiple record types (Free, Standard, Enhanced) (1) If you want to support 2-3 record types ("f4") on the same database file at the same time (i.e. Free, Standard and Enhanced), you must create 3 different sets of "ADD" and "EDIT" html templates (say "ADD-Free.tmpl", "EDIT-Free.tmpl", "ADD-Standard.tmpl", "EDIT-Standard.tmpl", "ADD-Enhanced.tmpl", "EDIT-Enhanced.tmpl"). Each of the above templates will serve one record type only. You must have a navigation webpage to guide your users to go to the appropriate "ADD" and "EDIT" page for submitting and updating their records. (2) *** Available in BizDB Advance Version Only *** If you want to sort the search result by record types (say, Enhanced first, Standard second and Free the third), the only way you can do is to setup the records as follows: "Free" record type - In your "Free Record" ADD and EDIT templates, set "f4" to "Free" and set "f??" to "3". "Standard" record type - In your "Standard Record" ADD and EDIT templates, set "f4" to "Standard" and set "f??" to "2". "Enhanced" record type - In your "Enhanced Record" ADD and EDIT templates, set "f4" to "Enhanced" and set "f??" to "1". where "f??" can be any field number between "f6" and "f50" selected by the user if $maxfields in the cgi scripts are set to 50. (3) When you produce the search report, you can sort (*** this feature is supported by the BizDB Advance version only ***) the "f??" field in ascending order. In this case, the "Enhanced" records will be displayed first. (4) It is essential not to change the existing definitions of "f1", "f2", "f3", "f4" and "f5". (5) In the "login.cgi" you must setup the variables storing the URLs of the Renewal Pages and the filenames of the Edit Record templates properly. (6) In the "login_check.cgi" you must setup the variables storing the filenames of the Edit Record templates properly. (7) In the "Member Area" template (see our sample: member-area.tmpl), you must use: Update or Delete Your Current Record instead of: Update or Delete Your Current Record The "login.cgi" and "login_check.cgi" scripts will replace any occurrence of the **template** tag by the properly filename of the Edit Record template that the authorized user should be using. This prevents that a "Free" listing user edits his record using an "Enhanced" listing template. ***** NOTE ***** No matter how many Add Record and Edit Record templates you are using, only one Member Area template is required. (8) Also in the "Member Area" template, you are allowed to install Html codes which will only be switched on if a given record type is identified. Below is an example: Html codes in the "member-area.tmpl" file: ........ ........ common html codes 1 ........ ........ common html codes 2 ........ ........ common html codes 3 ........ ........ common html codes 4 ........ If the record type of the user is "Free", the output (generated) Html of the "Member Area" page will be: ........ ........ common html codes 1 ........ ........ Required html codes for Free record type ........ ........ common html codes 2 ........ ........ common html codes 3 ........ ........ common html codes 4 ........ If the record type of the user is "Standard", the output (generated) Html of the "Member Area" page will be: ........ ........ common html codes 1 ........ ........ common html codes 2 ........ ........ Required html codes for Standard record type ........ ........ common html codes 3 ........ ........ common html codes 4 ........ (9) Finally you must setup your own procedure to bill users who will submit any one of the above 3 record types (see Section Q below). Q. How to bill users for "Fee-For-Posting" listings *** Only applicable to "Standard" and "Enhanced" record types. The concept is that when the user submits a new record, the "register.tmpl" template will instruct the "bizdb-aed.cgi" script to setup the default status as well as the expiry period for the record. This is done via the following FORM statements (example only): ("0" preferred) (preferred default status if) (expiry_period = 0) --> OR <-- (if a trial period is allowed) (i.e. expiry_period > 0) (You may still set "f5" to ("Inactive" even expiry_period (is greater than 0, but you) (must setup an Web UPDATE) (interface for the Webmaster) (to review the member record) (and change the record status) (to "Active" so that all other) (users can search and view this) (member record.) where "f5" = default record status, "expiry_period" = default expiry period (no. of days after submission) "f20" = Expiry Date Field ($expiryDate_fld was set to "f20") "f19" = Reminder Date Field ($reminderDate_fld was set to "f19") All new records will be added to the database by our "bizdb-aed.cgi" script. At this stage the user is not asked to pay for the registration or listing service. Note: To avoid searching the "Inactive" records by public users, your search template should be setup such that only "Active" records will be searched, i.e. in your search form, set "f5" to "Active". When should the Advertiser Pay the Fee: ======================================= When the user logins to the system via the login page (see our sample template: login.tmpl) and the "login.cgi" script detected that the user record is in "Inactive" state or has already expired, the user will be automatically directed to a order page (see our sample template: renewal-standard.tmpl) to pay for the service. Your "renewal-standard.tmpl" template must be properly setup so that it can pass the merchant account id and fee details to your merchant account server. Also you must pass a "Return URL" to your merchant account server so that at successful completion of the payment it will pass the control right back to the URL specified by your "Return URL". Example 1 (For database file supporting 1 record type only): The FORM statements used in your Renewal / Order Page:
Example 2 (For database file supporting multiple record types): - You must have one separate Renewal / Order Page for each listing (record) type. - In the Return Url form statement, you must specify the type of the listing currently handled using "M_recordtype=RecordType". The FORM statements used in your Renewal / Order Page for "Standard" Type Listing: The FORM statements used in your Renewal / Order Page for "Enhanced" Type Listing: ***************************************** Note 1: The name "return_url" could be different for your Merchant Account Server. Please check it out yourself. Note 2: The location of "ordered.cgi" could also be different on your server. Please set it up properly. Note 3: Anything within the text "ordered.cgi?M_dbname=**dbname**&M_userid=**userid**" must not be changed (See also Section K of "LoginControl-readme.txt"). This is because the tags: **dbname** and **userid** will be changed to the actual database filename and the actual userid (record id) by the "login.cgi" script when the Renewal page is detected to be displayed. Note 4: If you have 2 types of billable listings and you want to charge them ****** differently, you must setup 2 renewal templates to reflect the correct prices. **** Your "login.cgi" must be customized to check which renewal template should be called for the affected "listing / userid". Please write to us for a "Request for Change" quote. **** Note 5: We strongly suggest that you setup an information page upfront (on or before the "Add New Listing" page) to tell your user to press the "Login" link (Login) immediately after the submission to "Activate" and "Pay for" the listing. NOTE 6: In the "Renewal Page" template, do not use a record type (defined ****** by M_recordtype) which is different from the user's registered record type. This is not allowed. If a user wants to change his renewal plan (record type), he must register as a new member again using the right plan (i.e. the right "register new member" form). The user's old record listing can be either deleted by himself (through the "Update / Delete Listing" function in his "Member Area" page, or left expired and will be deleted by the webmaster later on using the "Batch Delete Records" form. Another Real Implementation Example: ==================================== You can first setup a "renewal-standard.tmpl" html template on your own server. In your "renewal-standard.tmpl" template, you should include a "FORM" to pass the merchant account specifc information and the return URL address "ret_addr" (see example below if you are using the iTransact secure server) to your third-party secure payment server. The "ret_addr" variable must be a valid URL that calls a "ordered.cgi" CGI program that exists in your own server. ************* EXAMPLE STARTS ************* The "FORM" that exists in your "renewal-standard.tmpl" template (interfacing to iTransact.com's secure payment server): First Name:
Last Name:
E-mail:
Street Address:
City:
State:
ZIP/Postcode:
Country:
Phone No:
In the next page (output by the third-part secure payment server), you will be asked to submit credit card details.
************* EXAMPLE ENDS ************* For a real demonstration, please visit and test our JSCart shopping cart software (http://www.cnctek.com/JSCart). -------------------------------------------------------------------------- Now you are ready to run your "Members Only BizDB Database". Good Luck! Best regards, Webmaster CNC Technology Web Site Design, Hosting and Marketing Services