Here's the same thing done in Perl.
Look in Actinic / Advanced / Network Setup and make the 2 changes as per the comments in the code above.
Save the file as secretname.pl or secretname.cgi depending on your server (that suffix is in Advanced / Network Setup / Extension).
Then FTP into your servers cgi-bin directory in ascii mode.
Run the script via http://myserver.com/cgi-bin/secretname.pl
Code:
#!/usr/bin/perl
# Configuration: look in Actinic / Advanced / Network Setup and do the following 2 changes
# Set top line to be #!<Path to the Perl shell>
# Set following line to be $dir = '<Path From CGI-BIN to acatalog Directory>';
$dir = '../acatalog/';
print "content-type: text/html\n\n<head><title>Live Info: $dir</title></head><body>";
print '<table bgcolor="#aaccee"><tr><td colspan=2><h3>' . (localtime time) . '</h3></td></tr>';
opendir D, $dir;
@entries = readdir D;
closedir D;
$sess = $ord = $occ = 0;
foreach $entry (@entries)
{
if ($entry =~ /\.ord$/){ $ord++ }
elsif ($entry =~ /\.occ$/){ $occ++ }
elsif ($entry =~ /\.session$/){ $sess++ }
}
print "<tr><td>Orders:</td><td>$ord</td></tr>";
print "<tr><td>Occ Sessions:</td><td>$occ</td></tr>";
print "<tr><td>Sessions:</td><td>$sess</td></tr>";
print "</table></body></html>";
Save the file as secretname.pl or secretname.cgi depending on your server (that suffix is in Advanced / Network Setup / Extension).
Then FTP into your servers cgi-bin directory in ascii mode.
Run the script via http://myserver.com/cgi-bin/secretname.pl
Comment