DLU said:
How or where do I get a way to count viewers tp the web site?
Try the code below.
It requires the right to run own perl-scripts.
Nicole
#!/usr/bin/perl -w
###################################################################
## Count It! Version 1.0 - 05/29/98 ##
## ------------------------------------------------------------- ##
## Copyright (C) 1998 Dimension's CGI Workshop ##
##
http://www.thenetnow.com/dimension ##
## dimension[- here was an add - ]cybered.net ##
# Path and name of data file (suggested that you leave this as is)
$datafile = "counts.dat";
#############################################
# $pagepath = $ENV{'DOCUMENT_URI'};
# $pagepath = "."; # bei Problemen wieder 1. Zeile
$pagepath = "/index.shtml";
print "Content-type: text/html\n\n";
# Ensure that the document exists; creates a new one if it does not
open(FILE, ">>$datafile");
close(FILE);
open(FILE, "$datafile");
@indata = <FILE>;
close(FILE);
# Folgende Zeile ist von Rudi 7-1-2003
# Bewirkt, dass leeres array abgefangen wird.
if (scalar(@indata) < 1) {exit;}
$onoff = 0;
open(FILE, ">$datafile");
foreach $temp (@indata)
{
chop($temp);
($uri, $count) = split(/\|/, $temp);
if ($uri eq $pagepath) {
$count++;
$onoff = 1;
print FILE "$uri|$count\n";
print "$count"; }
else { print FILE "$uri|$count\n"; }
}
if ($onoff eq 0) {
print FILE "$pagepath|1\n";
print "1"; }
close(FILE);