You can use the following sub-routine in the db.cgi file:
Code:
sub num_records {
# --------------------------------------------------------
# Displays the number of records
my $count = 0;
open (DB, "<$db_file_name") or &cgierr("error in num_records. unable to open dat
abase:$db_file_name.\nReason: $!");
LINE: while (<DB> ) {
if (!(/^#/) && !(/^\s*$/)) {
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
}
++$count;
}
close DB;
print $count;
}
Then in your
html.pl file, add the following codes to show the total number of records:
Code:
|; &num_records; print qq|
Hope this helps.
[Edited for the third time due to dumb errors on the part of the coder]
Regards,
------------------
Eliot Lee Anthro TECH,L.L.C
www.anthrotech.com ----------------------
[This message has been edited by Eliot (edited November 24, 1999).]
[This message has been edited by Eliot (edited December 18, 1999).]
[This message has been edited by Eliot (edited December 20, 1999).]