Forum Moderators: coopster
<?
$file = file_get_contents('http://www.mysite.com/log.html');
preg_match_all('/^([1-9]¦[1-9][0-9]¦1[0-9][0-9]¦2[0-4][0-9]¦25[0-5])(\.([0-9]¦[1-9][0-9]¦1[0-9][0-9]¦2[0-4][0-9]¦25[0-5])){3}$/',$file,$a);$count = count($a[1]);
echo "<b>Number of hack attempts ips</b> = " .$count."<p>";
for ($row = 0; $row < $count ; $row++) {
echo $a[1]["$row"]."<br>";
}
?>
The log file looks like
Referer: http://www.example.com/page1.htm, Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1), 203.26.142.253, Sunday 21st of December 2008 07:13:46 PM
Any help on this would be great I am trying to get a list of IPs in this format
127.0.0.1
10.10.10.1
192.168.0.1
ect
[edited by: dreamcatcher at 12:30 pm (utc) on Dec. 22, 2008]
[edit reason] use example.com. Thanks. [/edit]