I was wondering fi you guys could help me, it's something really small
I got this script on the internet
Code: Select all
<?php
// Log the ip
$ip = getenv("REMOTE_ADDR");
$log = "\n$ip";
$fa = fopen("login", "a");
$login = "$log";
fwrite($fa, $login);
fclose($fa);
?>And that works, and it logs the ip's.
But I want time stamps too, but i googled but couldn't find anything. (Maybe i searched the wrong terms =/ )
But I tried to fix this thing together and got this. (It's probably wrong)
Code: Select all
<?php
// Log the ip
$ip = getenv("REMOTE_ADDR");
$ts = mktime(date("G"), date("i"), date("s"), date("n"), date("j"), date("Y"));
$log = "\n$ip,\n$ts";
$fa = fopen("login", "a");
$login = "$log";
fwrite($fa, $login);
fclose($fa);
?>This is the result
Code: Select all
1177101654,
69.79.*.*Thanks in advance,TimeStamp - IP
Jumba