Stay Signed In
Do you want to access your site more quickly on this computer? Check this box, and your username and password will be remembered for two weeks. Click logout to turn this off.
Stay Safe
Do not check this box if you are using a public computer. You don't want anyone seeing your personal info or messing with your site.
<?php
$DB = new SQLiteDatabase("counter.db.sqlite");
if($DB -> query("PRAGMA table_info(counter)") -> numRows() == 0){
$DB -> query("BEGIN; CREATE TABLE counter(id INTEGER PRIMARY KEY, hits INT(11));
INSERT INTO counter (hits) VALUES('0');
COMMIT;
"); }
$DB -> query("UPDATE counter SET hits = hits + 1 WHERE id = 1");
$result = $DB -> query("SELECT * FROM counter WHERE id = 1");
if($result -> valid()){
$row = $result -> current();
$script = 'var nCell = document.getElementsByTagName("td"); '; $script .= 'for(c = 0; c < nCell.length; c ++){'; $script .= 'if(nCell.item(c).vAlign == "top" && nCell.item(c).width == "40 %"';
$script .= ' && nCell.item(c).innerHTML.match(/Total Members: /)){'; $script .= 'nCell.item(c).firstChild.appendChild(document.createElement("br")); ';
$script .= 'nCell.item(c).firstChild.appendChild(document.createTextNode("Visitors: '; $script .= number_format($row["hits"]) . '")); '; $script .= '}}; ';
echo $script;
}
?>