Skip to content

Instantly share code, notes, and snippets.

@ahrherrera
Last active July 1, 2018 03:22
Show Gist options
  • Save ahrherrera/f23081c8d8ac6e156bb8a66c4fdb868e to your computer and use it in GitHub Desktop.
Save ahrherrera/f23081c8d8ac6e156bb8a66c4fdb868e to your computer and use it in GitHub Desktop.
PHP script to log IP Address
<?php
header('Location: index1.php', true, 301);
$file='iplog.txt';
$f=fopen($file,'a');
fwrite($f,'————————-'.'n');
fwrite($f,'IP Address:'.$_SERVER['REMOTE_ADDR'].'n');
fwrite($f,'User Agemt:'.$_SERVER['HTTP_USER_AGENT'].'n');
fwrite($f,'Host Name:'.php_uname('n').'n');
fwrite($f,'Operating System:'.php_uname('v').'('.php_uname('s').')'.'n');
fclose($f);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment