Location: PHPKode > projects > WebServer Sentry > icept/sd.php
<?
include_once ('dbconnecticept.php');
$sql1="SELECT ip,COUNT(ip) FROM $tbl_name GROUP BY ip";
$vals=array();
$svals=array();
$result1=mysql_query($sql1);
$num=mysql_num_rows($result1);
while($row = mysql_fetch_array($result1)){
$a=$row['ip'];
$b=$row['COUNT(ip)'];
array_push($vals,$b);
}
$sum=array_sum($vals);
$count=count($vals);
$avg=$sum/$count;
#echo $sum;
echo "<br>";
#echo $count;
echo "<br>";
#echo $avg;
$variance=0;
$deviation=0;
echo "<br>";
foreach ($vals as $value) {
echo "<br>";
$variance = (pow($value-$avg, 2))+$variance;
$deviation = (sqrt($variance/($count)));
}
echo "AVG " . $avg;
echo "<br>";
echo "Variance " . $variance;
echo "<br>";
echo "Deviation " . $deviation;
#WebServer Sentry:-
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT	
#   Copyright Vic Kaprilian(C)2010 - Contact hide@address.com Version 1.0 WebServer Sentry Anti FLOOD/ANTI DOS SCRIPT
#WebServer Sentry uses PHPLOT class and IP2NATIONS and any licensing conditions of PHPLOT/IP2NATIONS remain with its respective copyright
#holder/licensing conditions.
#Reverse engineering this script is not permitted.Modifications to improve its performance are welcome as long as you document this at the sourceforge project page.
#Contact hide@address.com    
#########################################################################################################################################
#########################################################################################################################################
#Welcome to WebServer Sentry: Version 1.0:- Please note that Vic Kaprilian does not accept responsibility for the use of the script or any financial loss and it is being released because the E-Commerce/Internet needs it!.
?>


Return current item: WebServer Sentry