Volkova

[PHP] Log IP

Jul 5th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2. $myFile = "logs.txt";
  3. $fh = fopen($myFile, 'a') or die("can't open file");
  4. $stringData = "Time: " . time() . " - I.P: " . $_SERVER['REMOTE_ADDR'] . " Host: " . gethostbyaddr($_SERVER['REMOTE_ADDR']) ."\n";
  5. fwrite($fh, $stringData);
  6. fclose($fh);
  7. ?>
Advertisement
Add Comment
Please, Sign In to add comment