I use the following in my html.pl file...
Code:
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$catcount{$fields[X]}; # substitute YOUR category field # for X
}
close DB;
@options = split (/\,/, 'Category 1, Category 2, Category 3');
foreach $option (@options) {
$cat_link=&urlencode($option); #removed sort $option
unless ($catcount{$option}) { $catcount{$option} = '0'; }
print qq|<a href="$db_script_url?db=default&uid=$db_uid&Category=$cat_link&sb=2&so=descend&view_records=1">$option</a> ($catcount{$option})<BR>|;
}#}
I typically don't inquire into what my codes are used for and hope that this is not taken the wrong way, but what exactly is this a directory of?
[This message has been edited by oldmoney (edited March 08, 2000).]