#! /usr/bin/perl
open(hfile, "<visitor.txt");
@tab = <hfile>;
close(hfile);
foreach (@tab){
	$visitors = "$_";
}
if($ENV{'QUERY_STRING'} ne "no"){
	$visitors += 1;
	open(gfile, ">visitor.txt");
	print (gfile "$visitors\n");
	close(gfile);
}
open(hfile, "<../indexfr.html");
@tab = <hfile>;
close(hfile);
print "Content-type: text/html\n\n";
foreach (@tab){
	$_ =~ s|\$visiteurs|$visitors|g;
	$_ =~ s|src=\"|src=\"../|g;
        $_ =~ s|href=\"|href=\"../|g;
	$_ =~ s|src = \"images|src = \"../images|g;
	$_ =~ s|background=\"|background=\"../|g;
	print "$_";
}
