Created
March 30, 2016 18:48
-
-
Save FreeFly19/5cc80b8f637e065d4800355d1800e2f4 to your computer and use it in GitHub Desktop.
Get user ip and put to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello, dear user :) | |
<?php | |
$date = date("Y-m-d H:i:s"); | |
$userIp = $_SERVER['REMOTE_ADDR']; | |
$lastLineInFile = "[$date] $userIp\r\n"; | |
$file = fopen("file.txt", "a+"); | |
fwrite($file, $lastLineInFile); | |
fclose($file); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment