fala na vremenu free_sex-U ;)
e pa da ... SSI mi ne radi na serveru
a ovo za javaScript ... pa ... iskreno govoreci tako na to sam navikao, mislim jedino sto poznajem je JS ...
a sto se tice <iframe src="/cgi-bin/...."></iframe> ... ne znam dali je to onda stvarno iframe ? ili ... mislim, volim kada su mi stranice ciste .html bez frame-ova
a sto se tice tvog komentara:
"Nego ovako, hm, pa jedino da skripta uzme ip adresu od onoga ko radi request, i da ako ga vec nema upisuje na listu. Naravno svakih 1,2,3,4,5 minuta se brisu oni koji za to vreme nisu trazili niti jedan novi fajl (html). Znaci, trebas da postavis counter na svaku html stranicu."
to mi bas nista nije jasno kako da uradim posto perl ne znam ... jedino mi je jasno ono oko postavljanja na svaku stranicu a to bih hteo da izbegnem ... kao sto je onaj tip uradio na
http://www.easycount.nl/ ... evo kako je on resio obican counter ...
#!/usr/bin/perl
###################################################################################################################
# MultipleC is a simple and easy to setup perl text counter that does NOT require Server Side #
# Includes. To run the script, simply copy and paste the JavaScript code below into your html page #
# where you want a counter to appearance. #
# #
# <!-- This script and many more are available online at
http://www.easycount.nl --> #
# <script language="JavaScript" src="
http://your_site.com/cgi-bin/MultipleC/MultipleC.pl"></script> #
# #
# Setup MultipleC.pl #
# 1 - Set correct path to your perl in the first line above into this script. #
# 2 - Define variables #
# 3 - Copy MultipleC.pl to your cgi-bin directory, (make sure you do this in ASCII and chmod 755) #
# 4 - Done #
###################################################################################################################
# Homepage:
http://www.easycount.nl #
# Support forum:
http://www.easycount.nl/forum/ #
# Support email:
[email protected] #
# Last modify at Monday 8 December 2003, Free version: 1.3 Tested on Windows NT & Unix #
# Purchase easycount now and get fully support and alive time free updates. #
# #
# Copyright (c)2003 by Hans Versteeg,
[email protected] #
# Copyright must remain in the script and your now allow to change the script name. #
###################################################################################################################
###############################################################
# Define variables #
###############################################################
# Domain name where the script is located, (
http://www.yourdomain.com /
http://serverdomain.com/~your_home_page)
$domain="
http://www.easycount.nl";
# Use domain check, 1 = yes / 0 = no (if no, anyone could run your script),
$domain_check='0';
# Counter value, (you can change the value to start from a higher count),
$count_value='0';
# Reproduce counter in the center of your website, 1 = yes / 0 - no
$center='0';
# Block page refreshes, 1 = yes / 0 = no (if no, the script count all page requests),
$refresh='1';
###############################################################
# Output variables and comments. #
###############################################################
# Output personal visits, 1 = true / 0 = false
$personal_visits='1';
# Comment personal visits before the count,
$comment_personal="Personal visits:";
# Comment personal visits after the count,
$_comment_personal="/";
# Output unique visits, 1 = true / 0 = false
$unique_visits='1';
# Comment unique visits before the count,
$comment_unique="unique visitors:";
# Comment unique visits after the count,
$_comment_unique="/";
# Output total visits, 1 = true / 0 = false
$total_visits='1';
# Comment total visits before the count,
$comment_total="total visitors:";
# Comment total visits after the count,
$_comment_total="";
###############################################################
# Font Size/Color/Face/Style #
###############################################################
# Font Size,
$font_size='2';
# Font Color,
$font_color="#D9D900";
# Font Face,
$font_face="Arial";
# Bold, 1 = yes / 0 = no
$bold='0';
# Italic, 1 = yes / 0 = no
$italic='0';
###############################################################
# Done, do NOT change anything below. #
###############################################################
# Check domain,
$domain =~tr/A-Z/a-z/;
if ($domain_check ==1){
$true=0;
$ENV{'HTTP_REFERER'}=~tr/A-Z/a-z/;
if ($ENV{'HTTP_REFERER'} =~ /$domain/) {$true=1; }
if ( $true ==0) {
exit;
}
}
# Split domain,
$domain =~ s/http:\/\/www/\ /g;
$domain =~ s/http:\/\//\./g;
$domain =~ s/www/\ /g;
# Let's find out if we can get a remote addres,
if ($ENV{'HTTP_X_FORWARDED_FOR'}){
foreach $proxy ($ENV{'HTTP_X_FORWARDED_FOR'})
{($remote_addr,$proxy_addr)=split(/\,/,$proxy);
}
} elsif ($ENV{'HTTP_CLIENT_IP'}){$remote_addr=$ENV{'HTTP_CLIENT_IP'};}
else {$remote_addr=$ENV{'REMOTE_ADDR'};
}
# Get time and date
@months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug", "Sep","Oct","Nov","Dec");
@days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time + (86400*366));
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($mday < 10) { $mday = "0$mday"; }
$year += 1900;
$expdate = "$days[$wday], $mday-$months[$mon]-$year $hour:$min:$sec GMT";
if ($ENV{'HTTP_COOKIE'}) {
@cookies = split(/; /, $ENV{'HTTP_COOKIE'});
foreach $cookie (@cookies) {
($name, $value) = split(/=/, $cookie);
$mycookies{$name} = $value;
} if ($mycookies{'IP'} ne "$remote_addr"){&setcookie();}
} else {
&setcookie();
}
open(DBASE,"count.num");
@read_data=<DBASE>;
close(DBASE);
foreach $line (@read_data) {
$i++;
}
foreach $id (@read_data){
chop($id);
($ip,$counts)=split(/\|/,$id);
if (($mycookies{'IP'} =~ "$ip")||($remote_addr =~ "$ip")){
if (($refresh !=0)&&($mycookies{'REFRESH'})){
&counts();
} elsif ($refresh==0){$counts++;}
else {&end_session();
$counts++;
}
open(DBASE,"count.num");
@read_data=<DBASE>;
close(DBASE);
$line = join ("|","$remote_addr","$counts");
splice(@read_data, $lines, 1,"$line\n");
open(DBASE,">count.num");
flock(DBASE, 2);
print DBASE @read_data;
flock(DBASE, 8);
close(DBASE);
&counts();
}
$lines++; }
$counts=1;
$i=$i+1;
&end_session();
# update dbase,
$line = join ("|","$remote_addr","$counts");
open(DBASE,">>count.num");
flock(DBASE, 2);
print DBASE ("$line\n");
flock(DBASE, 8);
close(DBASE);
&counts();
sub setcookie {
print "Set-Cookie: IP=$remote_addr; path=/; expires=$expdate; domain=$domain;\n";
} sub end_session {
print "Set-Cookie: REFRESH=$refresh; path=/; domain=$domain;\n";
} sub counts {
print "Content-Type: application/x-javascript\n\n";
print "document.write(\'";
if (($personal_visits ==0)&&($unique_visits ==0)&&($total_visits ==0)){
print "\');\n";
exit;
}
open(DBASE,"count.num");
@read_data=<DBASE>;
close(DBASE);
if ($center !=0){
print "<CENTER>";}
if ($bold !=0){
print "<B>";}
if ($italic !=0){
print "<I>";
} # Respect my work, so please do not remove the link below.
print "<a href=\"
http://www.easycount.nl\" target=\"_blank\">";
print "<font face=\"$font_face\" size=\"$font_size\" color=\"$font_color\">";
if ($personal_visits !=0){
$comment_personal =~ s/'/\\'/g;
$_comment_personal =~ s/'/\\'/g;
print "$comment_personal $counts $_comment_personal ";
} if ($unique_visits !=0){
if ($count_value !=0){
$i=$i+$count_value;
} $comment_unique =~ s/'/\\'/g;
$_comment_unique =~ s/'/\\'/g;
print "$comment_unique $i $_comment_unique ";
} if ($total_visits !=0){
foreach $visitor (@read_data){
chop($visitor);
($ip,$counts)=split(/\|/,$visitor);
$total=$counts+$total;
} if ($count_value !=0){
$total=$total+$count_value;
} $comment_total =~ s/'/\\'/g;
$_comment_total =~ s/'/\\'/g;
print "$comment_total $total $_comment_total ";
} print "</font>";
if ($bold !=0){
print "</B>";}
if ($italic !=0){
print "</I>";}
if ($center !=0){
print "</CENTER>";
} print "</a>\');\n";
exit;
}
pretpostavljam da je na slican nacin resio i online counter ???