Zend - The PHP Company




Miscellaneous

Add Code


CodeRed Counter  

Type: code fragment
Added by: Peppe316
Entered: 12/08/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 5408
Show everyone how many times you've been hit by the CodeRed Virus


<?
    
/*****************************
    ** OpenSource
    ******************************
    ** Created by the http://www.CodeHeadz.net team
    ***********************************************
    */
    
$file "c:\Apache\logs\error.log";
    
$fp fopen($file"r");
    
$contents fread($fpfilesize($file));
    
fclose($fp);
    
$count preg_match_all('/(default.ida)/'$contents$match);
?>
<html>
<head>
<title>CodeRed Hits</title>
</head>
<body bgcolor="#000000" alink="#FFFFFF" vlink="#FFFFFF" >
<center><font face="fixedsys" size="+3" color="#FF0000">CodeRed Hit Count</font>
<br>
<br>
<font face="fixedsys" size="+11" color="#FF0000"><?php echo $count?></font></center>
<br><br>
<font face="fixedsys" size="1" color="#FFFFFF">Visit <a href="http://www.codeheadz.net">www.CodeHeadz.net</a></font>
</body>
</html>


Usage Example


See the example


Rate This Script





Search



This Category All Categories