Ok...så tager vi den med mysql
. Kræver at laver en tabel i db'en ved navn iplog.
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("YmdHis");
$query = "INSERT INTO iplog (ip,date) VALUES ('$ip','$date')";
mysql_query($query) or die(mysql_error());
Til at udskrive log. Du kan selv bytte rundt på output formatet hvis du vil.
//export log
$query = mysql_query("SELECT * FROM iplog");
while ($row = mysql_fetch_array($query))
{
$date = $row['date'];
$ip = $row['ip'];
$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6,2);
$hour = substr($date,8,2);
$minute = substr($date,10,2);
$second = substr($date,12,2);
echo "$ip @ $day/$month - $year - $hour:$minute:$second";
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GED d- s: a--- C++ !U P L+ E? W++ N? o? K? w
!O M+ V? PS !PE Y+ PGP++ t 5? X+ R tv+ b+ DI- D+
G e- h! !r y--
------END GEEK CODE BLOCK------
Failure is not an option, it\\'s included with the software. - Murphys Law
[Redigeret d. 14/12-05 19:28:18 af Jonas (Decko)]