soapmyster
09-30-2004, 12:46 AM
ok this is working..but one problem.
the counter works Great with IE..but on browser, like AOL that frequently changes the IP..this counter would log that and the number would increase. So thats No Good!!
would adding a cookie log work and if so how would do this.
Here is what I have in my CGI file..
print "Content-Type: text/html\n\n";
if ($IP_Logging eq "1") {
open(IPLOG,"$IP_Log");
@ips = <IPLOG>;
close(IPLOG);
foreach $ip (@ips) { chomp($ip);
if ($ip eq "$ENV{REMOTE_ADDR}") {
$match = 1;
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$count</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }
exit;
}
}
if (! $match) {
open(IPLOG,">>$IP_Log");
print IPLOG "$ENV{REMOTE_ADDR}\n";
close(IPLOG);
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
$nextnumber = ($count) + (1);
open(COUNTLOG1,">$Count_Log");
print COUNTLOG1 "$nextnumber";
close(COUNTLOG1);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$nextnumber</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }
}
exit;
}
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
$nextnumber = ($count) + (1);
open(COUNTLOG1,">$Count_Log");
print COUNTLOG1 "$nextnumber";
close(COUNTLOG1);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$nextnumber</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }
the counter works Great with IE..but on browser, like AOL that frequently changes the IP..this counter would log that and the number would increase. So thats No Good!!
would adding a cookie log work and if so how would do this.
Here is what I have in my CGI file..
print "Content-Type: text/html\n\n";
if ($IP_Logging eq "1") {
open(IPLOG,"$IP_Log");
@ips = <IPLOG>;
close(IPLOG);
foreach $ip (@ips) { chomp($ip);
if ($ip eq "$ENV{REMOTE_ADDR}") {
$match = 1;
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$count</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }
exit;
}
}
if (! $match) {
open(IPLOG,">>$IP_Log");
print IPLOG "$ENV{REMOTE_ADDR}\n";
close(IPLOG);
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
$nextnumber = ($count) + (1);
open(COUNTLOG1,">$Count_Log");
print COUNTLOG1 "$nextnumber";
close(COUNTLOG1);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$nextnumber</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }
}
exit;
}
open(COUNTLOG,"$Count_Log");
$count = <COUNTLOG>;
close(COUNTLOG);
$nextnumber = ($count) + (1);
open(COUNTLOG1,">$Count_Log");
print COUNTLOG1 "$nextnumber";
close(COUNTLOG1);
if ($Bold eq "1") { print "<B>"; }
if ($Underline eq "1") { print "<U>"; }
if ($Italics eq "1") { print "<I>"; }
print "<FONT FACE=\"$Font_Face\" SIZE=\"$Font_Size\" COLOR=\"$Font_Colour\">$Before <b>$nextnumber</b> $After</FONT>";
if ($Italics eq "1") { print "</I>"; }
if ($Underline eq "1") { print "</U>"; }
if ($Bold eq "1") { print "</B>"; }