Also ich mir da ein Counter gebastelt (ganz poblig). Ich hab folgendes Problem das keine IP Sperre (also das wenn einer innerhalb von 1 Minute 28 mal meine Seite aufruft nur einmal gezählt wird) drin ist un ich zu DOOF bin das zu Programmieren
Der Counter sieht so aus:
#!/usr/local/bin/perl -w
use strict;
my $counterdatei = "counter.dat";
use Fcntl qw
DEFAULT :flock);
sysopen(FH, "$counterdatei", O_RDWR | O_CREAT) ;
# autoflush FH
my $ofh = select(FH);
$| = 1;
select ($ofh);
flock(FH, LOCK_EX) ;
my $num = <FH> ;
seek(FH, 0, 0) ;
$num++;
print FH "$num\n" ;
truncate(FH, tell(FH)) ;
close(FH) ;
my $zaehlerstand = $num;
print "Content-type: text/plain\n\n";
print "zaehlerstand=$zaehlerstand&fertig=1";
exit;
Kann mir einer helfen??
[Edited by klark on 19-01-2001 at 17:18]
Der Counter sieht so aus:
#!/usr/local/bin/perl -w
use strict;
my $counterdatei = "counter.dat";
use Fcntl qw
sysopen(FH, "$counterdatei", O_RDWR | O_CREAT) ;
# autoflush FH
my $ofh = select(FH);
$| = 1;
select ($ofh);
flock(FH, LOCK_EX) ;
my $num = <FH> ;
seek(FH, 0, 0) ;
$num++;
print FH "$num\n" ;
truncate(FH, tell(FH)) ;
close(FH) ;
my $zaehlerstand = $num;
print "Content-type: text/plain\n\n";
print "zaehlerstand=$zaehlerstand&fertig=1";
exit;
Kann mir einer helfen??
[Edited by klark on 19-01-2001 at 17:18]