I said it worked before I actually fully tested it lol, Anyway It now appends the two new IP's to the one file (Database.html) But it no longer overwrites if its the same IP.
Urg!
Code:
December 13, 2009, 9:59 am 192.145.643.222
Code:
December 13, 2009, 10:00 am 192.145.643.222
Code:
<?php
$logfile= 'make1.html';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http://dnsstuff.com/tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>';
$fp = fopen($logfile, "a");
fwrite($fp, $logdetails);
fwrite($fp, "<br>");
fclose($fp);
$data1 = file("make1.html");
$data2 = file("make2.html");
file_put_contents('Database.html', implode('', array_unique(array_merge($data1,$data2))), FILE_APPEND);
unlink('make1.html');
unlink('make2.html');
$ourFileName = "make1.html";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
$ourFileName = "make2.html";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
?>