das in eure haupt php einfügen
Die SQL
PHP
CREATE TABLE `antiddos` (
`ips` char(255) NOT NULL DEFAULT '',
`load` int(2) DEFAULT '0',
KEY `ips` (`ips`)
) TYPE=MyISAM;
PHP
<?php
include("include/connect.php");
$load = file_get_contents("".$url."");
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$load,$avgs);
$current=$avgs[1];
//echo $current;
if($current >20)
{
$ip = $_ENV['REMOTE_ADDR'];
mysql_query("INSERT INTO `antiddos` (`ips`,`load`) VALUES ('$ip','$current')") or sqlerr(__FILE__, __LINE__);
echo "Der Server Load ist zu hoch, wir stehen unter einer DoS attacke. ALLE IP AKTIVITÄTEN WERDEN IN DIESER ZEIT GELOGGT";
exit;
}
else{
echo "";
}
?>
Alles anzeigen
nun eine connect.php erstellen und anpassen
PHP
<?php
mysql_connect("localhost","DATABASE_USER","DB_PASS");
mysql_select_db("DB_DATABASE");
$url = "http://www.Your-URL.com/metaltorrents/server_info.php"; // Pfad zur server_info.php
?>
nun eine ddosadmin.php
PHP
<p align="center"><a href="truncate.php">Clear Database</a><br />
<em>Its HIGHLY recomended that you clear the database on a daily basis. </em></p>
<div align="center">
<table width="622" border="1">
<tr>
<td width="571"><div align="center" class="style1">Anti-DDoS Elite</div></td>
</tr>
</table>
<table width="622" border="1">
<tr>
<td width="571"><div align="center">IP Address</div></td>
<td width="571"><div align="center">Number Times accessed</div></td>
</tr>
<?php
include("include/connect.php");
$result = mysql_query("SELECT ips, COUNT(ips) AS NumOccurrences FROM antiddos GROUP BY ips HAVING ( COUNT(ips) > 1 ) order by NumOccurrences desc");
while($r=mysql_fetch_array($result))
{
$ips=$r['ips'];
$NumOccurrences=$r['NumOccurrences'];
echo "<tr><td>$ips</td><td>[$NumOccurrences]</td></tr>";
}
?>
</table>
</div>
<?
stdfoot();
?>
Alles anzeigen
und eine truncate.php
PHP
<?
include("include/connect.php");
mysql_query("TRUNCATE TABLE `antiddos`");
?>
<?
die("Clean Database<br>Database Cleared!");
?>
hoffe jetzt wird mir auch bei meinem prob geholfen
https://www.forum-hilfe.de/showthread.php?t=39751