Ik use this whois online script set to 900 sec. 15 min ;-)
Is there a better way to do this?
<script>
my $sth = $dbh->prepare("select username from user_cookies");
$sth->execute;
$dbh->disconnect();
my $url = 'https://www.mydomain.nl/crm-bin/users.pl';
my $refresh = 900;
&refreshpage;
exit;
sub now {
local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
local($tz) = "CST";
$tz =~ s/ST/DT/ if ($isdst);
$sec = "0".$sec if ($sec < 10);
$min = "0".$min if ($min < 10);
$mon++;
$year += 1900;
return "$mon/$mday/$year $hour:$min:$sec $tz";
}
sub &refreshpage {
local($date) = &now;
print "Content-type: text/html\n\n";
print qq¦<META HTTP-EQUIV=REFRESH CONTENT="$refresh; URL=$url">\n¦;
my $i = 0;
my $sep;
print qq¦
<html>
<body style="margin:0 0 0 0">
<span style="font-size:70%;font-family:verdana, arial, sans-serif;color:\#000099">Online: </span>
¦;
while (my ( $user ) = $sth->fetchrow_array() )
{
$i++;
print qq¦<span style="font-size:70%;font-family:verdana, arial, sans-serif;color:\#000099">$sep $user $sep </span>¦;
if ( $i >= 1){
$sep = "\¦";}
}
print qq¦
</body>
</html>
¦;
</script>
[edited by: Perllover at 10:56 am (utc) on Jan. 28, 2008]