Lid |
|
ik heb een teller (met hulp) gemaakt en hij telt alleen 1 bezoeker en daarna doet hij niets meer
hier staat de teller http://www.vvmaasbracht.nl/vierkant.php
(database wachwoorden heb ik weggelaten)
ik zet de codes er ook bij hier staan ze
bezoekers/index.php
<?php
ob_start();
error_reporting(E_ALL);
include("config.php");
mysql_connect($conf['MysqlHost'], $conf['MysqlUser'], $conf['MysqlPass']);
mysql_select_db($conf['MysqlDb']);
?>
<html>
<head>
<title>Statistieken :: <?php echo $conf['Titel']; ?></title>
<style>
body, td { font-family: Verdana; font-size: x-small; }
</style>
</head>
<body>
<center>
<?php
if($conf['Totaal']) {
$query = mysql_query("SELECT * FROM stats GROUP BY ip") or die(mysql_error());
$uhits = mysql_num_rows($query);
$hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats"), 0, "total");
$query = mysql_query("SELECT * FROM stats GROUP BY datum") or die(mysql_error());
$delen = mysql_num_rows($query);
$total = $uhits + $hits;
$bar1 = round($hits / $total * 100);
$bar2 = round($uhits / $total * 100);
?>
<table border="0" cellpadding="5" cellspacing="0" width="100%" style="border: 1px solid #DDDDDD;">
<tr>
<td colspan="2" style="border-bottom: 1px dashed #DDDDDD;" bgcolor="#EFEFEF"><b>Totaal</b></td>
</tr>
<tr>
<td width="140">Hits: (<?php echo $hits; ?>)</td>
<td><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width="<?php echo $bar1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width="<?php echo $bar2 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td>
</tr>
<tr>
<td width="140" bgcolor="#EFEFEF">Unieke hits: (<?php echo $uhits; ?>)</td>
<td bgcolor="#EFEFEF"><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width="<?php echo $bar2; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width="<?php echo $bar1 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td>
</tr>
</table>
<br>
<?php
}
$select1 = mysql_query("SELECT * FROM stats GROUP BY datum ORDER BY datum DESC LIMIT 0,".$conf['Limit']) or die (mysql_error());
while($get = mysql_fetch_object($select1)) {
$select = mysql_query("SELECT * FROM stats WHERE datum = '".$get->datum."'") or die (mysql_error());
$uhits = mysql_num_rows($select);
$hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats WHERE datum = '".$get->datum."'"), 0, "total");
$total = $uhits + $hits;
$bar1 = $hits / $total * 100;
$bar2 = $uhits / $total * 100;
$date = explode("-", $get->datum);
?>
<table border="0" cellpadding="5" cellspacing="0" width="100%" style="border: 1px solid #DDDDDD;">
<tr>
<td colspan="2" style="border-bottom: 1px dashed #DDDDDD;" bgcolor="#EFEFEF"><b><?php echo $date[2]."-".$date[1]."-".$date[0]; ?></b></td>
</tr>
<tr>
<td width="140">Hits: (<?php echo $hits; ?>)</td>
<td><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width="<?php echo $bar1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width="<?php echo $bar2 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td>
</tr>
<tr>
<td width="140" bgcolor="#EFEFEF">Unieke hits: (<?php echo $uhits; ?>)</td>
<td bgcolor="#EFEFEF"><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width="<?php echo $bar2; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width="<?php echo $bar1 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td>
</tr>
</table>
<br>
<?php
}
?>
</center>
</body>
</html>
<?php include("config.php"); mysql_connect($conf['MysqlHost'], $conf['MysqlUser'], $conf['MysqlPass']); ?> <html> <head> <title>Statistieken :: <?php echo $conf['Titel']; ?></title> <style> body, td { font-family: Verdana; font-size: x-small; } </style> </head> <body> <center> <?php if($conf['Totaal']) { $total = $uhits + $hits; $bar1 = round($hits / $total * 100); $bar2 = round($uhits / $total * 100); ?> <table border="0" cellpadding="5" cellspacing="0" width="100%" style="border: 1px solid #DDDDDD;"> <tr> <td colspan="2" style="border-bottom: 1px dashed #DDDDDD;" bgcolor="#EFEFEF"><b>Totaal</b></td> </tr> <tr> <td width="140">Hits: ( <?php echo $hits; ?>)</td> <td><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width=" <?php echo $bar1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width=" <?php echo $bar2 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td> </tr> <tr> <td width="140" bgcolor="#EFEFEF">Unieke hits: ( <?php echo $uhits; ?>)</td> <td bgcolor="#EFEFEF"><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width=" <?php echo $bar2; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width=" <?php echo $bar1 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td> </tr> </table> <br> <?php } $select1 = mysql_query("SELECT * FROM stats GROUP BY datum ORDER BY datum DESC LIMIT 0,".$conf['Limit']) or die (mysql_error()); $hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats WHERE datum = '".$get->datum."'"), 0, "total"); $total = $uhits + $hits; $bar1 = $hits / $total * 100; $bar2 = $uhits / $total * 100; ?> <table border="0" cellpadding="5" cellspacing="0" width="100%" style="border: 1px solid #DDDDDD;"> <tr> <td colspan="2" style="border-bottom: 1px dashed #DDDDDD;" bgcolor="#EFEFEF"><b> <?php echo $date[2]."-".$date[1]."-".$date[0]; ?></b></td> </tr> <tr> <td width="140">Hits: ( <?php echo $hits; ?>)</td> <td><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width=" <?php echo $bar1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width=" <?php echo $bar2 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td> </tr> <tr> <td width="140" bgcolor="#EFEFEF">Unieke hits: ( <?php echo $uhits; ?>)</td> <td bgcolor="#EFEFEF"><img src="bar_line.gif" width="1" height="15"><img src="bar_1.gif" width=" <?php echo $bar2; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"><img src="bar_2.gif" width=" <?php echo $bar1 - 1; ?>%" height="15"><img src="bar_line.gif" width="1" height="15"></td> </tr> </table> <br> <?php } ?> </center> </body> </html>
bezoekers/stats.php
<?php
include("config.php");
mysql_connect('localhost','prive','prive');
mysql_select_db('prive');
$query = mysql_query("SELECT * FROM stats WHERE ip = '".$_SERVER['REMOTE_ADDR']."' AND datum = '".date("Y-m-d")."'") or die(mysql_error());
$count = mysql_num_rows($query);
if($count == 0) {
$query = "INSERT INTO stats (ip, datum, hits) VALUES ('".$_SERVER['REMOTE_ADDR']."', '".date("Y-m-d")."', '1')";
} else {
$obj = mysql_fetch_object($query);
$hits = $obj->hits + 1;
$query = "UPDATE stats SET hits = '".$hits."' WHERE ip = '".$_SERVER['REMOTE_ADDR']."' AND datum = '".date("Y-m-d")."'";
}
mysql_query($query) or die(mysql_error());
?>
<?php include("config.php"); if($count == 0) { $query = "INSERT INTO stats (ip, datum, hits) VALUES ('".$_SERVER['REMOTE_ADDR']."', '".date("Y-m-d")."', '1')"; } else { $hits = $obj->hits + 1; $query = "UPDATE stats SET hits = '".$hits."' WHERE ip = '".$_SERVER['REMOTE_ADDR']."' AND datum = '".date("Y-m-d")."'"; } ?>
bezoekers.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
ob_start();
error_reporting(E_ALL);
include("bezoekers/config.php");
mysql_connect($conf['MysqlHost'], $conf['MysqlUser'], $conf['MysqlPass']);
mysql_select_db($conf['MysqlDb']);
?>
<html>
<head>
<title>Statistieken :: <?php echo $conf['Titel']; ?></title>
<style>
body, td { font-family: Verdana; font-size: x-small; }
</style>
</head>
<body>
<center>
<?php
if($conf['Totaal']) {
$query = mysql_query("SELECT * FROM stats GROUP BY ip") or die(mysql_error());
$uhits = mysql_num_rows($query);
$hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats"), 0, "total");
$query = mysql_query("SELECT * FROM stats GROUP BY datum") or die(mysql_error());
$delen = mysql_num_rows($query);
$total = $uhits + $hits;
$bar1 = round($hits / $total * 100);
$bar2 = round($uhits / $total * 100);
?>
aantal bezoekers vanaf 21-12-05: <font color="#00FF00"><br><?php echo $uhits; ?></font>
<br>
<?php
}
$select1 = mysql_query("SELECT * FROM stats GROUP BY datum ORDER BY datum DESC LIMIT 0,".$conf['Limit']) or die (mysql_error());
while($get = mysql_fetch_object($select1)) {
$select = mysql_query("SELECT * FROM stats WHERE datum = '".$get->datum."'") or die (mysql_error());
$uhits = mysql_num_rows($select);
$hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats WHERE datum = '".$get->datum."'"), 0, "total");
$total = $uhits + $hits;
$bar1 = $hits / $total * 100;
$bar2 = $uhits / $total * 100;
$date = explode("-", $get->datum);
?>
<?php
}
?>
</center>
</body>
</html>
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php include("bezoekers/config.php"); mysql_connect($conf['MysqlHost'], $conf['MysqlUser'], $conf['MysqlPass']); ?> <html> <head> <title>Statistieken :: <?php echo $conf['Titel']; ?></title> <style> body, td { font-family: Verdana; font-size: x-small; } </style> </head> <body> <center> <?php if($conf['Totaal']) { $total = $uhits + $hits; $bar1 = round($hits / $total * 100); $bar2 = round($uhits / $total * 100); ?> aantal bezoekers vanaf 21-12-05: <font color="#00FF00"><br> <?php echo $uhits; ?></font> <br> <?php } $select1 = mysql_query("SELECT * FROM stats GROUP BY datum ORDER BY datum DESC LIMIT 0,".$conf['Limit']) or die (mysql_error()); $hits = mysql_result(mysql_query("SELECT sum(hits) as total FROM stats WHERE datum = '".$get->datum."'"), 0, "total"); $total = $uhits + $hits; $bar1 = $hits / $total * 100; $bar2 = $uhits / $total * 100; ?> <?php } ?> </center> </body> </html>
bezoekers/config.php
<?php
$conf['MysqlHost'] = "localhost"; // Mysql host (meestal localhost)
$conf['MysqlUser'] = "prive"; // Mysql gebruiker
$conf['MysqlPass'] = "prive"; // Mysql wachtwoord
$conf['MysqlDb'] = "prive"; // Mysql database
###########################################
$conf['Titel'] = "RKVV Maasbracht"; // Titel van je site
$conf['Totaal'] = TRUE; // TRUE als hij het totaal moet laten zien en FALSE als dat niet moet
$conf['Limit'] = 30; // Van hoeveel dagen moet hij de statistieken laten zien
?>
<?php $conf['MysqlHost'] = "localhost"; // Mysql host (meestal localhost) $conf['MysqlUser'] = "prive"; // Mysql gebruiker $conf['MysqlPass'] = "prive"; // Mysql wachtwoord $conf['MysqlDb'] = "prive"; // Mysql database ########################################### $conf['Titel'] = "RKVV Maasbracht"; // Titel van je site $conf['Totaal'] = TRUE; // TRUE als hij het totaal moet laten zien en FALSE als dat niet moet $conf['Limit'] = 30; // Van hoeveel dagen moet hij de statistieken laten zien ?>
|