# DB Based Member Directory README File
# Version 1.0
# By Mike Calabrese
# http://www.mikecalabrese.com
# 2/16/2001
# This program is available for free on an AS-IS basis. I am not
# responsible for consequential damages, loss of income or whatever
# else that may happen as a result of the use of this program.
This program allows one to build and maintain a dynamic web/database based
membership directory. This program requires access to a MySQL database. It
could be used with other databases but the Perl DBI calls for these databases
will have to be modified. The program consists of 13 files, 11 of which are
Perl scripts. This README file will explain how to configure these scripts
to run on your website. This program has been tested successfully in both
UNIX and LINUX environments.
Any MySQL questions should be directed to either your database
administrator, or refer to the book MySQL by Paul DuBois. This is a
fantastic reference for MySQL that I highly recommend.
If you downloaded the tarred and compressed version of this program,
the directory structures are already in place. If you elected to get
the files for this program via the email Perl script, you will have to
set up the directory structure for the program as follows:
dbmbrdir (directory)
README
dbindex.pl
dbmbrdir.pl
member.sql
dbtools (directory)
dbadd1.pl
dbadd2.pl
dbdelete1.pl
dbdelete2.pl
dbdelete3.pl
dbedit1.pl
dbedit2.pl
dbedit3.pl
dbmain.pl
maxmbrnofile
If you got the program via the tar.Z download this structure is already
in place for you. Generally speaking, all directories should be chmodded
to 755, all files ending in .pl should be chmodded to 755 and all
remaining files should be chmodded to 777.
On all of the Perl scripts be sure that your path to Perl is correct and
that the Perl reference is the first line of the script. You can find
your correct path to Perl by typing which perl at the command line.
The following is a description of how each file should be configured:
dbindex.pl- There is really nothing to configure on this launch pad as all the
links are relative. This is the only optional script of the group as
you should link the DB Based Member Directory (dbmbrdir.pl) so that it is
viewable to your intended audience and the DB Based Main Tools Screen
(dbmain.pl) so that it is accessable only to the administrator.
dbmbrdir.pl- This is the page that generates the membership list. There is
1 variable on this page that needs to be congigured. $maxmbrnodir should point
to the exact UNIX path to the dbtools directory. The way to find this out
is to go to that directory and type pwd. (An example of how the path should
look is something like /users/sites/yourdomain/cgi-bin/dbmbrdir/dbtools.)
There are comments in the code that tell you where to insert the login name,
password and password to connect to your database.
member.sql- This is a file that you use to create the member table in
your MySQL database. The command to load this file in MySQL is:
load_file(/exact/UNIX/path/to/member.sql)
This will create the member table that this application utilizes. You must
create the member table before you start inserting, updating or deleting
member records.
dbadd1.pl- This page gathers information for the Member Directory and sends
it to the next screen, dbadd2.pl. The only line that has to be configured
here is the POST line. Be sure that this points to the exact HTML path to the
file dbadd2.pl.
dbadd2.pl- This script inserts the member information into the database from
the data that was received from dbadd1.pl. In this script, make sure that the
the exact UNIX path is specified for the maxmbrnodir. Again, make sure that
you specify your database name, login and password so the application can
connect to the database and insert the data.
dbdelete1.pl- In this script make sure that the POST statement points to
the exact HTML path to the dbdelete2.pl file and that the link that points
to the Member Directory is the exact HTML path to dbmbrdir.pl. This script
merely gathers the member number to be deleted and passes that number
onto dbdelete2.pl.
dbdelete2.pl- This script does a select statement, shows the information on
the screen and verifies that this is the correct record to be deleted. In this
script, make sure that the the exact UNIX path is specified for the
maxmbrnodir file. Again, make sure that you specify your database name, login
and password so the application can connect to the database and insert the
data. Lastly, make sure that this file points to the exact HTML path to the
dbdelete3.pl script.
delete3.pl- This script actually does the deleting of the record and then
tells you that it was done.The maxmbrno variable is decreased by 1 if the
member you deleted is the last one.
dbedit1.pl- This script merely asks you which member record number you want
to modify and passes it onto dbedit2.pl. Just make sure that the POST
statement points to the exact HTML path to dbedit2.pl.
dbedit2.pl- This script checks to see if the member number is valid, then
does a select statement and displays the record on a web page. Again, be sure
to insert your database name, login and password so that the application can
comnnect properly to the database.
dbdit3.pl- This script takes the data that you have modified on the previous
screen and updates that record in the database. Again, make sure to insert
your database name, login and password so that the application can comnnect
properly to the database.
maxmbrnofile- This file contains the starting member number that
is selected during the add or delete mode. No further configuration is
required here unless you want to change the starting member number.
main.pl- This is the main menu for the admin tools. If the files are placed
properly in the directories, there should be no further configuration
necessary here.
This is an overall description of how the program works:
The mbrdir.pl script does a series of select statements and prints them to the
screen until there are no more records to display. The add scripts insert the
member record and increase the maxmbrnofile by 1. The edit scripts do a
select statement for a given member record and places it into an HTML form
which allows you to edit that record. It then overwrites the record with your
nges by doing an update on that record. The delete scripts delete a record
and decrease the maxmbrnofile by 1 if it is the last file.