Author | Message |
---|
Meka][Meka Unstopable Posts: 700
| This will show the IP address of the visitor.
Code: | <?php echo $_SERVER['REMOTE_ADDR']; ?> |
|
ThomAce n00b Posts: 18
| One more way to show the wisitors IP address:
Code: | <?php print $REMOTE_ADDR; ?> | And if u need a remote comp IP:
Code: | <?php print gethostbyname("thomace.myip.hu"); ?> |
|
Naruto n00b Posts: 20
| hmmm, how to do an code that logs the IP and the Time in a txt file?
|
ThomAce n00b Posts: 18
|
Quoted from Naruto | hmmm, how to do an code that logs the IP and the Time in a txt file? | Here is a little hint for you:
Code: | <?php //================================================\\ //=== Simple logfile writer. made by ThomAce ===\\ //================================================\\ $logfile = "log.log"; //your logfile name, extension and relative path. $address = $REMOTE_ADDR; //visitor's ip address. $fa = @fopen($logfile, "a") or die ("The logfile not writable"); //opening the logfile. flock($fa, 2); //locking the file for writing. fputs($fa, "[" . date("Y.m.d - H:i:s") . "] " . $address . " "); //write datas to the logfile and use windows style new line. // if you need use the unix type newline: \n. flock($fa, 3); //file unlocking. fclose($fa); //closing the file. ?> |
|
Naruto n00b Posts: 20
| great thx
|