} else {
    if ($_POST['internal'] == "yes") {
        print " checked";
    }
}
?>
> Count internal users<br>
			<input type="submit" value=" Submit ">
		</form>
		<p style="font-size:0.7em;text-align:right;">&copy; 2005 Alexander M&uuml;ller <a href="http://www.EvoComp.de" title="www.EvoComp.de">www.EvoComp.de</a></p>
	</div>
	<div style="display:inline;">
<?php 
require_once 'simplecounter.php';
$counter = new SimpleCounter("localhost", "tracimp", "root", "");
if (isset($_POST['init_date']) && isset($_POST['visit_start']) && isset($_POST['hit_start'])) {
    if (is_numeric($_POST['hit_start']) && is_numeric($_POST['hit_start'])) {
        $counter->initCounter($_POST['init_date'], intval($_POST['visit_start']), intval($_POST['hit_start']));
    }
}
print "<table style=\"margin:60px 10px;\" border=\"1\"><tr colspan=\"2\"><td><b>Counter status</b></td></tr><tr><td>Users online:</td><td align=\"right\">" . $counter->getUsersOnlineCount() . "</td></tr>";
print "<tr><td>Visits today:</td><td align=\"right\">" . $counter->getTodaysVisitCount() . "</td></tr>";
print "<tr><td>Hits today:</td><td align=\"right\">" . $counter->getTodaysHitCount() . "</td></tr>";
print "<tr><td>Counting since:</td><td align=\"right\">" . $counter->getCounterStartDate() . "</td></tr>";
print "<tr><td>Visits total:</td><td align=\"right\">" . $counter->getTotalVisitCount() . "</td></tr>";
print "<tr><td>Hits total:</td><td align=\"right\">" . $counter->getTotalHitCount() . "</td></tr></table>";
?>
	</div>
</body>
</html>
Esempio n. 2
0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Demonstration of the SimpleCounter</title>
		<meta name="author" content="Alexander M&uuml;ller">
		<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	</head>
<body>
<?php 
// include the counter class
require_once 'simplecounter.php';
// create counter instance with standard session timeout
$counter = new SimpleCounter("tracimp.db.4803900.hostedresource.com", "tracimp", "tracimp", "My#58@envi");
// print counter state
print "Users online: " . $counter->getUsersOnlineCount() . "<br>";
print "Visits today: " . $counter->getTodaysVisitCount() . "<br>";
print "Hits today: " . $counter->getTodaysHitCount() . "<br>";
print "Counting since: " . $counter->getCounterStartDate() . "<br>";
print "Visits total: " . $counter->getTotalVisitCount() . "<br>";
print "Hits total: " . $counter->getTotalHitCount() . "<br>";
?>
</body>
</html>